简体   繁体   中英

Rails server not running after updating to ruby 2.1.4

I was using rails 4.1.7 with ruby 2.0.0 and have developed an application. Recently upgraded to ruby 2.1.4 and made that as "Local" setting using rbenv. Now after doing "gem install rails", everything installed well.

Question is now if I try to run server, i am getting error "Could not find rake-10.4.0 in any of the sources Run bundle install to install missing gems."

bundle show rake reveals that its installed under "bundle show rake /Library/Ruby/Gems/2.0.0/gems/rake-10.4.0"

Shouldn't this be under 2.1.4?

Use or to change ruby and gem space to another one. If you will begin usage of the them do the following ( NOTE : If you already use one of them, just begin with point 2):

  1. 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 
  2. Enter to the project, create two files .ruby-version with just installed version of ruby (in example 2.1.4 ), and .ruby-gemset with name of your project:

     $ cd project-folder $ echo "2.1.4" > .ruby-version $ echo "your-project-name" .ruby-gemset 
  3. Fix Gemfile with newly intsalled version of ruby adding a line:

     ruby '2.1.4' 
  4. Reenter to the project folder, and rvm will generate its wrappers:

     $ cd .. ; cd project-folder 
  5. Issue gem installation:

     $ bundle install 

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM