Trinculo
Trinculo

Reputation: 2021

Ruby version is X, but Gemfile is Y mismatch

Whenever I run a rails command (e.g. rails s), I get a message saying "Your Ruby version is X, but you Gemfile specified is Y". I've searched and searched and all of the answers either say to update/install bundler (which I have), or obviously that it is using the wrong version (which I am not as you can see from the output). I'm not even sure where it is getting 2.1.5 from since I am using rvm. When I do rails new app_name, I am getting an error that says No such file or directory -- /usr/bin/bundle (LoadError)...so that does correspond to something with bundler, but I can't quite figure it out. I am using Ubuntu 15.10.

12:50 $ rails
Your Ruby version is 2.1.5, but your Gemfile specified 2.3.0
12:50 $ ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
12:50 $ rvm ls

rvm rubies

   ruby-2.2.1 [ x86_64 ]
=* ruby-2.3.0 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

Upvotes: 0

Views: 770

Answers (1)

Kirka121
Kirka121

Reputation: 505

do

rvm --default use 2.3.0

to set your default version of ruby. then install rails in that version of ruby.

Upvotes: 1

Related Questions