简体   繁体   English

没有这样的红宝石版本

[英]No such ruby version

I am having a really strange problem with my current environment. 我目前的环境有一个非常奇怪的问题。

I am using rbenv, and I have my global and local version of ruby set to ruby 1.9.3-p448 我正在使用rbenv,并且将ruby的全局和本地版本设置为ruby 1.9.3-p448

I can even run: 我什至可以跑步:

$ ruby -v
ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-darwin12.3.0]

My bundle works just fine, but as soon as I run: 我的捆绑软件可以正常运行,但是一旦我运行:

bundle exec rails server

I get: 我得到:

env: ruby1.9.1: No such file or directory

I know this is a project specific problem, because I can boot up other rails servers just fine. 我知道这是一个项目特定的问题,因为我可以正常启动其他Rails服务器。 I am guessing this implies that my project is somehow trying to link my ruby 1.9.3 with ruby1.9.1 我猜这意味着我的项目正在以某种方式尝试将我的ruby 1.9.3与ruby1.9.1链接

Does anyone have any debugging ideas? 有没有人有任何调试想法? I feel like I have tried everything. 我觉得我已经尝试了一切。 =/ = /

您可能在Gemfile中有一个ruby声明,或者在项目中有一个.ruby-version.rbenv-version文件,并指定了您所没有的Ruby。

Just to make sure you have it in your current ruby environment, do this: 为了确保您在当前的红宝石环境中拥有它,请执行以下操作:

gem install bundler
rbenv rehash
bundle install # optionally, include --binstubs
bundle exec rails server

As it turns out, there was a file in the project, .bundle/config, that said: 事实证明,项目中有一个文件.bundle / config,内容为:

BUNDLE_PATH: vendor/bundle

I took a look in vender/bundle, and sure enough there were two directories, 1.8.7 and 1.9.1 我看了一下供应商/捆绑销售商,确定有两个目录,分别为1.8.7和1.9.1。

I'm sure to get my project working with 1.9.3, i would either have to create a new directory there, or remove the bundle path from my .bundle config. 我确定我的项目可以使用1.9.3,我要么必须在那里创建一个新目录,要么从我的.bundle配置中删除捆绑路径。

To resolve this, I'm just going to get 1.9.1 installed. 为了解决这个问题,我将安装1.9.1。 O_o O_o

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM