Rbenv Your version of Ruby is 2.0.0, but your Gemfile is 2.1.2

I am using rbenv and I am executing the following error while doing rails s

Your version of Ruby 2.0.0, but your Gemfile is 2.1.2

I read this thread: Mavericks, RBENV, your version of Ruby 2.0.0, but your Gemfile is 2.1.1

But the error persists.

 rails -v Your Ruby version is 2.0.0, but your Gemfile specified 2.1.2 

and teams

 sudo gem install bundler rbenv rehash 

$ which ruby /usr/bin/ruby

$ bundle exec which ruby Your Ruby version is 2.0.0, but your Gemfile specified 2.1.2

doenst solves the problem. Am I doing something wrong?

+5
source share
3 answers

What version of ruby ​​are you using?

ruby -v

Gemfile seems to have a ruby ​​requirement specified in 2.1.2. You may need to install this version:

rbenv install 2.1.2

You may then need to specify rbenv to use this version for this project:

rbenv local 2.1.2

It appears that the rbenv team / community has decided not to add support for the ruby ​​versions specified in the Gemfile. Link: https://github.com/sstephenson/rbenv/issues/223

+4
source

If you get this in a Rails project and recently updated your ruby ​​version, you can spring work with the old version of Ruby. ./bin/spring stop fix this.

+3
source

If it's macOS and your new Ruby from homebrew, try sudo gem bundler

0
source

Source: https://habr.com/ru/post/1207541/


All Articles