Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Your Ruby version is 2.2.4, but your Gemfile specified 2.3.0?

I'm trying to bundle install a ruby project in Git Bash but I'm getting the above message.

ruby -v

ruby 2.2.4p230 (2015-12-16 revision 53155) [i836-mingw32]

gem -v

2.3.0

New to Ruby so its really frustrating. I'm trying to do the project below http://www.viralrails.com/?p=25

like image 955
richie Avatar asked Mar 08 '16 08:03

richie


2 Answers

Install bundler after installing ruby 2.4.0.

gem install bundler

If you installed bundler before installing ruby 2.4.0 then you should reinstall bundler or update it.

Also if the above command didn't work.

gem update bundler
like image 98
Ahmad Avatar answered Oct 12 '22 22:10

Ahmad


This happens because you are specifying a Ruby version in your Gemfile (2.3.0) and this version is not installed or is not the current or default version.

Don't remove the line ruby '2.3.0' as someone said above. You app may have dependencies to this version. Do the following:

1) Check if you have Ruby 2.3.0 installed. If you are using rvm this may be done by

rvm list

and if you are using rbenv by

rbenv versions

2) If you don't have this Ruby version in your list of installed versions, then install it by issuing the following command

rvm install 2.3.0

and if you are using rbenv by

rbenv install 2.3.0

3) If you already had Ruby 2.3.0 installed or completed step 2 above, enter your app directory and issue the following command

rvm use 2.3.0

and if you are using rbenv by

rbenv local 2.3.0

Then run

bundle install

and I believe things will be ok.

Hope it helps!

like image 36
Ed de Almeida Avatar answered Oct 12 '22 23:10

Ed de Almeida