0

I have a bit of a weird situation. I'm using rbenv on my production server. Now I wanted to access the console:

cd $HOME/rails/current RAILS_ENV=production bundle exec rails console

Now Instead of the console opening I'm seeing:

Usage:


rails new APP_PATH [options]

Options:
  -r, [--ruby=PATH]
...

Some information:

which ruby
/home/myuser/.rbenv/shims/ruby

ruby -v
ruby 2.6.10p210 (2022-04-12 revision 67958) [x86_64-linux]

rbenv local
2.6.10

uname -a
Linux myserver 5.15.0-57-generic #63-Ubuntu SMP Thu Nov 24 13:43:17 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

I also tried:

RAILS_ENV=production rbenv exec bundle exec rails c

Debugging:

rails -v
bundle exec rails -v
rbenv exec bundle exec rails -v
# they all yield the following:
Rails 4.2.11.3
3
  • Yes. I can run rake routes without problems Commented Apr 2, 2023 at 13:58
  • @dbugger: it results in rails 4.2.11.3 (I also updated the question accordingly) Commented Apr 2, 2023 at 16:18
  • 1
    The only way I can reproduce your error is attempting to run rails console in a directory that does not have a rails app installed. Commented Apr 3, 2023 at 10:47

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.