0

Note: This is not a duplicate of this stack post. The solution to my question is bundle update. The solution to the allegedly duplicate post is gem update bundler, which I tried and which did not work. It is a different command. Please remove the duplicate flag.

Rails application. I have looked at these stack posts:

Your version is 2.3.1 but gemfile specified 2.4.1

Your version is 2.2.4 but gemfile specified 2.3.0

Your version is 2.0.0 but gemfile specified 2.1.0

Your version is 2.3.0 but gemfile specified 2.2.5

Running rails s yields Your version is 2.3.4, but your Gemfile specified 2.4.1.

This is easily fixed by changing to ruby '2.3.4' in my Gemfile, but I would like to use the newer version.

I've run:

rvm use ruby-2.4.1

rvm reinstall ruby-2.4.1

gem update bundler

bundle

Importantly: ruby -v yields ruby 2.4.1p111

So, why is it saying my version is 2.3.4? What am I missing?

EDIT: Please see the answer below. The final step should be bundle update.

John
  • 521
  • 1
  • 7
  • 23

1 Answers1

2

Your last step should be bundle update instead of bundle:

rvm use ruby-2.4.1
bundle update

I would not specify ruby in Gemfile, I'd rather specify it in .rvmrc of rails root, so that ruby version manager reads it; where as Gemfile is for gem versions.

Adobe
  • 12,967
  • 10
  • 85
  • 126
  • You should be aware that bundle update will update every gem possible, which, depending on how restrictive you set versions in your Gemfile might easily break your application. – trueunlessfalse Sep 18 '18 at 19:52