Failed to create new rails app - `load ': unable to load such file - / home / *** /. Rvm / gems / ruby-2.2.0 / gems / rails-4.2.0 / bin / rails (LoadError)

I cannot start rails new SomeApp

.

I am getting 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 down the path to:, /home/captainawesome/.rvm/gems/ruby-2.2.0/gems/rails-4.2.0/bin/rails

the bin directory does not exist .

Also, please know that I can still start 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 be aware that this only works internally.


$ 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 <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]

      

Please advise how to fix this.

+3


source to share


2 answers


Reinstall Rails and it will solve your error:

Here's how:



gem install rails 

      

And try using separate gemsets for your Rails applications, this will allow you to quickly and automatically change your Ruby version and associated gems as you do cd your_project_name

. Here's how .

+4


source


To add to Arslan Ali's correct answer, you can also avoid endless installation of documentation. If you are as impatient as I am, then:

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

      



However, haste and forgetfulness also come with impatience. Fortunately, you can make the docs skipping the default using the method described in this SO post: How do I make --no-ri --no-rdoc the default for installing a gem?

+2


source







All Articles