You try to do some work on an old project which you haven't worked on for a while. You start up your development environment and try running the specs to make sure everything's in order, but you get the error:
Your Ruby version is 2.1.8, but your Gemfile specified 2.3.3
Looks like things have moved on since you last worked on the project...
The surest way to solve this issue is to destroy your development environment and provision it again from scratch, but before you do that you can try:
vagrant provision
Which will re-provision the box on top of what you already have.
After that you might still get the same error, which is odd when ruby -v
tells you the right version.
This happened to me using rbenv
so I tried the following things to resolve it:
-
gem install bundler
because you don't have bundler installed for the new version of Ruby (see https://stackoverflow.com/a/20936316) -
bundle install
because you don't have any gems installed for the app