Looks like i have a problem trying to install rails gem.
so i followed the steps from this tutorial , I am using Ubuntu 14.04, rbenv and ruby version 2.2.3
Basically my error is:
apparently I installed rails gem successfully
$ gem install rails -v 4.2.4
-> Successfully installed rails-4.2.4
but whenever i try to use rails command, for example:
$ rails -v
-> bin/rails:9:in require': cannot load such file -- rails/commands (LoadError) from bin/rails:9:in < main >'
And got the same result for any other rails command
I searched everywhere and noone seem to have the same problem as I do. I dont really know what to do now, any help will be really appreciated.
Thanks in advance!!
UPDATE: apparently when I enter to a previously created rails app and try to run a rails command, this happens:
Could not find rake-10.5.0 in any of the sources
Run `bundle install` to install missing gems.
so after I run bundle install
everything works normally as it should... but if I leave the folder, then I am no longer able to use rails anymore, so I cannot create a new rails app or anything
It sounds like you are sitting inside of a Rails repository already, since there is a bin/rails
. So try running bundle install
first---and if necessary gem install bundler
before that.
I believe rails gem is not installed into your gemset try installing rails gem to gemset with :
sudo gem install rails
If problem still persists then may be your installations are not good & I recommend you to follow this Link to install ruby through rvm and then install rails gem to your gemset it will work.
Open console
Select Edit -> Profile Preferences
Select tab: Title and Command
Check box 'Run command as a login shell'
Restart terminal
and try rvm use 2.2.1 --default
gem install rails --no-rdoc --no-ri
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.