6

I have installed RVM and and Ruby 1.9.3 . But when I do rails c, I get this error

-bash: rails: command not found

I had done bundle install from my Rails app, and it was successful. But when i do gem list, I get this

*** LOCAL GEMS ***

bundler (1.3.5)
rubygems-update (2.1.3)
rvm (1.11.3.8)

What could be wrong?

5
  • 1
    Try to make ruby 1.9.3 as default for rvm and then repeat bundle install. You probably installed rails under other ruby version... Commented Sep 17, 2013 at 7:48
  • No, i had made ruby 1.9.3 as default before bundling. Commented Sep 17, 2013 at 7:49
  • @Casper, I did not run gem install rails. But when I ran bundle install, it installed all the gems from my Gemfile, including rails. But none of them are visible when i do gem list Commented Sep 17, 2013 at 7:54
  • 1
    Bundler and gem list are not connected to each other necessarily. Bundler can install gems into an application specific folder, which is not always the system folder (where gem list gets its information from). You need to have rails in the system gem folder. But if you don't want that then just run script/rails instead. Commented Sep 17, 2013 at 7:56
  • 4
    can you start the console with "bundle exec rails c"? Commented Sep 17, 2013 at 8:13

3 Answers 3

14

As Mattherick suggests, try bundle exec rails c

Sign up to request clarification or add additional context in comments.

Comments

3

You can try enable the option "run command as a login shell" in your terminal profile.

2 Comments

You might want to explain how to do this in your answer
If you are using linux, open your terminal (for example: $ gnome-terminal). Click in Edit -> Profile Preferences. Check the option "run command as a login shell"
0

You may remove the gemfile.lock file before running bundle install Or run bundle update.

Comments

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.