Bundler :: RubyVersionMismatch:您的Ruby版本是1.9.3,但是您的Gemfile指定了2.0.0 [英] Bundler::RubyVersionMismatch: Your Ruby version is 1.9.3, but your Gemfile specified 2.0.0

查看:64
本文介绍了Bundler :: RubyVersionMismatch:您的Ruby版本是1.9.3,但是您的Gemfile指定了2.0.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将Mac与Pow,Ruby,Rails和许多有用的宝石一起使用.每当我尝试打开我的应用程序时,我都会收到此错误.

I am using a Mac with Pow, Ruby, Rails and a bunch of useful gems. I recently got this error whenever I try to open my app.

Bundler :: RubyVersionMismatch:您的Ruby版本是1.9.3,但是您的Gemfile指定了2.0.0

我理解该错误,但是在这里找不到为什么它没有使用正确版本的原因.

I understand the error, but I can't find why it is not using the proper version here.

一些有用的信息:

Bundler::RubyVersionMismatch: Your Ruby version is 1.9.3, but your Gemfile specified 2.0.0
~/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/definition.rb:361:in `validate_ruby!'
~/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler.rb:116:in `setup'
~/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/setup.rb:17:in `<top (required)>'
~/Dropbox/Documents/project/Sites/project-profile/config.ru:3:in `block in <main>'
~/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/lib/nack/builder.rb:4:in `instance_eval'
~/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/lib/nack/builder.rb:4:in `initialize'
~/Dropbox/Documents/project/Sites/project-profile/config.ru:1:in `new'
~/Dropbox/Documents/project/Sites/project-profile/config.ru:1:in `<main>'
~/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/lib/nack/server.rb:50:in `eval'
~/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/lib/nack/server.rb:50:in `load_config'
~/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/lib/nack/server.rb:43:in `initialize'
~/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/lib/nack/server.rb:13:in `new'
~/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/lib/nack/server.rb:13:in `run'
~/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/bin/nack_worker:4:in `<main>'

RVM和Ruby版本

$> ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.5.0]
$> rvm use 
Using /Users/Alex/.rvm/gems/ruby-2.0.0-p247

知道我在这里缺少什么吗?谢谢!

Any idea what I am missing here? Thanks!

推荐答案

我终于在 RVM文档中找到了解决方案:

I finally found out the solution in RVM documentation:

Pow删除了对rvm的自动检测,这是可以的通过在项目的根目录中创建.powenv来恢复Pow docs不应将其签入源代码管理(除非所有团队成员对此表示同意.

Pow has removed automated detection of rvm, here is how it can be restored by creating .powenv in the root of the project, according to Pow docs it should not be checked in to source control (unless all team members agree on that).

这些行必须添加到项目根目录的 .powenv 文件中.然后,在重新启动服务器后,一切都像灵符一样工作!

These lines must be added to the .powenv file at the root of your project. Then after restarting the server everything worked like a charm!

# detect `$rvm_path`
if [ -z "${rvm_path:-}" ] && [ -x "${HOME:-}/.rvm/bin/rvm" ]
then rvm_path="${HOME:-}/.rvm"
fi
if [ -z "${rvm_path:-}" ] && [ -x "/usr/local/rvm/bin/rvm" ]
then rvm_path="/usr/local/rvm"
fi

# load environment of current project ruby
if
  [ -n "${rvm_path:-}" ] &&
  [ -x "${rvm_path:-}/bin/rvm" ] &&
  rvm_project_environment=`"${rvm_path:-}/bin/rvm" . do rvm env --path 2>/dev/null` &&
  [ -n "${rvm_project_environment:-}" ] &&
  [ -s "${rvm_project_environment:-}" ]
then
  echo "RVM loading: ${rvm_project_environment:-}"
  \. "${rvm_project_environment:-}"
else
  echo "RVM project not found at: $PWD"
fi

这篇关于Bundler :: RubyVersionMismatch:您的Ruby版本是1.9.3,但是您的Gemfile指定了2.0.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆