I created a Ruby project, but when running bundle update
and bundle install
it returns an error:
Your Ruby version is 1.9.3, but your Gemfile specified 2.0.0
An image of it is: http://i.imgur.com/dZMhI11.png?1
My gemfile is:
ruby '2.0.0' #ruby-gemset=railstutorial_rails_4_0 gem 'rails', '4.0.0' group :development do gem 'sqlite3', '1.3.8' end gem 'sass-rails', '4.0.0' gem 'uglifier', '2.1.1' gem 'coffee-rails', '4.0.0' gem 'jquery-rails', '3.0.4' gem 'turbolinks', '1.1.1' gem 'jbuilder', '1.0.2' group :doc do gem 'sdoc', '0.3.20', require: false end
Process: install the gem generically, looking up your target version on rubygems.org, then update and version your Gemfile. the install command is in the right-hand column. then you can: gem install gem_name -v 1.5.
run the command bundle install in your shell, once you have your Gemfile created. This command will look your Gemfile and install the relevant Gems on the indicated versions. The Gemfiles are installed because in your Gemfile you are pointing out the source where the gems can be downloaded from.
I've noticed this happening when I've tried to bundle install
with a fresh RVM gemset that didn't yet include bundler (as it fell back on the system bundler install which referenced the system ruby).
Running gem install bundler
fixed for me.
None of these worked for me, but I finally figured it out:
spring stop
I had a Rails 4 project that uses something called Spring to keep a Rails environment running in the background, for speed.
I had started Spring with Ruby 2.1.1 but then I upgraded to 2.1.2 (in Gemfile and .ruby-version). My theory is that Spring kept on running on 2.1.1 and so caused this error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With