Bundler似乎无法通过Rbenv找到正确的Ruby [英] Bundler can't seem to find correct Ruby through Rbenv
问题描述
多年来,我一直使用RVM作为我的Ruby版本管理器,但是为了简单起见,我想切换到rbenv。但是,我发现一些奇怪的部署问题。这似乎是哪里出错了:
#env RBENV_ROOT = \ /home/deploy/.rbenv\ PATH = \ /home/deploy/.rbenv/shims:/home/deploy/.rbenv/bin:$PATH\ /home/deploy/.rbenv/bin/rbenv exec捆绑安装--gemfile / domains / myapp .com / releases / 20140119013611 / Gemfile --path /domains/myapp.com/shared/bundle --deployment-未经开发测试
> rbenv:bundle:找不到命令
>这些Ruby版本中存在 bundle命令:
> 2.0.0-p353
好的,所以我指定了我想要的rbenv版本-
#env RBENV_ROOT = \ /home/deploy/.rbenv\ PATH = \ /home/deploy/.rbenv/填充:/home/deploy/.rbenv/bin:$ PATH\ RBENV_VERSION = \ 2.0.0-p353\ /home/deploy/.rbenv/bin/rbenv exec捆绑安装--gemfile / domains / myapp.com/releases/20140119013611/Gemfile --path /domains/myapp.com/shared/bundle --deployment-未经开发测试
> rbenv:未安装版本 2.0.0-p353
呵呵。
#rbenv版本
>系统
> * 2.0.0-p353(由/home/deploy/.rbenv/version设置)
任何想法我要去哪里错了? 捆绑安装
命令似乎认为没有 2.0.0-p353
,但是 rbenv版本
显示它。
我认为这是一个逃避的问题。
我可以成功设置当前的红宝石版本:
rbenv local 2.0 .0-p247
或以下内容:
rbenv local 2.0.0-p247
但是,如果我转义了引号,则会出现与您完全相同的错误(请注意引号在错误响应中):
> rbenv local \ 2.0.0-p247\
rbenv:未安装版本 2.0.0-p247
请注意,通常引号不在aa伪造版本附近:
> rbenv local 2.0.0-p111
rbenv:版本`2.0.0-p111`
因此,总而言之,我猜测第一个代码段中会调用无捆绑程序的系统ruby,由于RBENV_VERSION引用问题,您还没有成功尝试与rbenv托管版本捆绑。 p>
For years I used RVM as my Ruby version manager, but I want to switch to rbenv for its simplicity. However I'm finding some strange problems deploying. Here's where it seems to go wrong:
# env RBENV_ROOT=\"/home/deploy/.rbenv\" PATH=\"/home/deploy/.rbenv/shims:/home/deploy/.rbenv/bin:$PATH\" /home/deploy/.rbenv/bin/rbenv exec bundle install --gemfile /domains/myapp.com/releases/20140119013611/Gemfile --path /domains/myapp.com/shared/bundle --deployment --without development test
> rbenv: bundle: command not found
> The `bundle' command exists in these Ruby versions:
> 2.0.0-p353
Okay, so I specify the rbenv version I want --
# env RBENV_ROOT=\"/home/deploy/.rbenv\" PATH=\"/home/deploy/.rbenv/shims:/home/deploy/.rbenv/bin:$PATH\" RBENV_VERSION=\"2.0.0-p353\" /home/deploy/.rbenv/bin/rbenv exec bundle install --gemfile /domains/myapp.com/releases/20140119013611/Gemfile --path /domains/myapp.com/shared/bundle --deployment --without development test
> rbenv: version `"2.0.0-p353"' is not installed
Huh. That's weird.
# rbenv versions
> system
> * 2.0.0-p353 (set by /home/deploy/.rbenv/version)
Any idea where I'm going wrong? The bundle install
command appears to think that 2.0.0-p353
is absent, but rbenv versions
shows it. What might be up?
I believe it's an escaping problem.
I can set the current ruby version like this successfully:
rbenv local 2.0.0-p247
or this:
rbenv local "2.0.0-p247"
But if I escape the quotes, I get an error exactly like you get (notice the quotes in the error response):
> rbenv local \"2.0.0-p247\"
rbenv: version `"2.0.0-p247"' not installed
Note that usually quotes are not around a a bogus version:
> rbenv local 2.0.0-p111
rbenv: version `2.0.0-p111`
So, in conclusion, I'm guessing that the bundler-less system ruby is invoked in your first snippet, and you haven't yet seen a successful attempt to try bundle with the rbenv managed version due to the RBENV_VERSION quoting issue.
这篇关于Bundler似乎无法通过Rbenv找到正确的Ruby的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!