Rails server does not work after upgrading to ruby ​​2.1.4

I used rails 4.1.7 with ruby ​​2.0.0 and developed an application. Recently upgraded to ruby ​​2.1.4 and made it as "Local" using rbenv. Now, after executing "gem install rails", everything is installed well.

The question now, if I try to start the server, I get the error "Could not find rake-10.4.0 in any of the sources Run bundle install to install the missing gems.

shows that its installed under the "bundle" / Library / Ruby / Gems / 2.0.0 / gems / rake-10.4.0 "

Shouldn't it be in 2.1.4?

0
ruby-on-rails rbenv
source share
1 answer

Use rvm or rbenv to change the ruby ​​and gem space to another. If you start using them, follow these steps ( NOTE : if you are already using one of them, just start from step 2):

  • Install rvm with ruby:

     $ \curl -sSL https://get.rvm.io | bash -s stable --ruby 

    or install rbenv and then install ruby ​​and make it global:

     $ \curl https://raw.githubusercontent.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash $ rbenv install 2.1.4 $ rbenv global 2.1.4 
  • Enter the project, create two .ruby-version files only with the installed ruby version (in example 2.1.4 ) and .ruby-gemset with the name of your project:

     $ cd project-folder $ echo "2.1.4" > .ruby-version $ echo "your-project-name" .ruby-gemset 
  • Fix the Gemfile with the new intsalled version of ruby with the addition of a line:

     ruby '2.1.4' 
  • Go back to the project folder, and rvm will create its own wrappers:

     $ cd .. ; cd project-folder 
  • Install gem installation:

     $ bundle install 
0
source share

All Articles