我正在使用 rbenv
并且在执行 rails s
时出现以下错误
Your Ruby version is 2.0.0, but your Gemfile specified 2.1.2
我正在阅读此主题:Mavericks, RBENV, Your Ruby version is 2.0.0, but your Gemfile specified 2.1.1
但错误仍然存在。
rails -v
Your Ruby version is 2.0.0, but your Gemfile specified 2.1.2
和命令
sudo gem install bundler
rbenv rehash
$ ruby
/usr/bin/ ruby
$ bundle exec which ruby
你的 Ruby 版本是 2.0.0,但是你的 Gemfile 指定了 2.1.2
确实解决了问题。 我做错了什么?
最佳答案
您使用的是什么版本的 ruby ?
ruby -v
这听起来像是 Gemfile 列出了 2.1.2 的 ruby 要求。您可能需要安装该版本:
rbenv 安装 2.1.2
然后您可能需要告诉 rbenv 为该项目使用该版本:
rbenv 本地 2.1.2
看起来 rbenv 团队/社区决定不添加对 Gemfile 中指定的 ruby 版本的支持。引用:https://github.com/sstephenson/rbenv/issues/223
关于ruby-on-rails - rbenv 你的 Ruby 版本是 2.0.0,但是你的 Gemfile 指定了 2.1.2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27094643/