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 rvm or rbenv 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):
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 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
Fix Gemfile
with newly intsalled version of ruby
adding a line:
ruby '2.1.4'
Reenter to the project folder, and rvm
will generate its wrappers:
$ cd .. ; cd project-folder
Issue gem installation:
$ bundle install