I'm unable to run rails new SomeApp.

I receive the following error:

load': cannot load such file -- /home/captainawesome/.rvm/gems/ruby-2.2.0/gems/rails-4.2.0/bin/rails (LoadError)

Going through the path in: /home/captainawesome/.rvm/gems/ruby-2.2.0/gems/rails-4.2.0/bin/rails, the bin directory does not exist.

Also, please know I can still run the rails server and console but not rails new app.

My current setup

Ubuntu 14.04
ruby 2.2.0p0
rails 4.2.0
rvm 1.26.11
local server (not remote)
development environment

$ which rails
/home/captainawesome/.rvm/gems/ruby-2.2.0/bin/rails

$ rails -v
Bundler is using a binstub that was created for a different gem.
This is deprecated, in future versions you may need to "bundle binstub rails"
to work around a system/bundle conflict.

Rails 4.2.0

Please know this only works inside of a project.


$ which ruby
/home/captainawesome/.rvm/rubies/ruby-2.2.0/bin/ruby

$ ruby -v
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]

$which rvm
/home/captainawesome/.rvm/bin/rvm

$ rvm use
Using /home/captainawesome/.rvm/gems/ruby-2.2.0

$ rvm -v
rvm 1.26.11 (master) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]

Please advise on how to correct this.

3

There are 3 answers

1
Arslan Ali On BEST ANSWER

Re-install Rails, and it will solve your error:

Here's how:

gem install rails 

And try to use separate gemsets for your Rails applications, this will allow you to quickly and automatically change your Ruby version and associated gems when you do cd your_project_name. Here's how.

0
B. Bulpett On

To add to Arslan Ali's correct answer, you can also avoid endless installation of documentation. If you're impatient like me, do:

gem install rails --no-ri --no-rdoc

However with impatience also comes haste and forgetfulness. Luckily you can make skipping docs the default using method described in this SO post: How to make --no-ri --no-rdoc the default for gem install?

0
Jonas On

Update to B. Bulpett's answer which is deprecated, the new way of installing without documentation is

gem install rails -​-no-document