RVM 似乎不能很好地与 ruby​​-1.9.3-preview1 配合使用

发布于 2024-12-06 12:55:55 字数 857 浏览 0 评论 0原文

我按照以下步骤更新我的 rvm 后安装了 ruby​​-1.9.3-preview1:

 » rvm get head
 » rvm reload
 » rvm install ruby-1.9.3-preview1

然后我为我的项目创建一个 gem 集并尝试使用它。

 » rvm --create ruby-1.9.3@myproject
 » rvm use ruby-1.9.3@myproject

我通过以下方式测试它:

 » ruby -v                         
ruby 1.9.3dev (2011-07-31 revision 32789) [x86_64-darwin11.1.0]

但是当我尝试使用它时:

 » bundle exec rails server
/Users/<home>/.rvm/gems/ruby-1.9.2-p290@envision/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `block in require': iconv will be deprecated in the future, use String#encode instead.
=> Booting WEBrick

它似乎仍然使用旧版本的 Ruby。有其他人遇到这个问题还是我做错了什么?

编辑

我原本打算安装最新的 ruby​​-1.9.3-rc1。我按照上述相同的步骤改用它,但仍然遇到同样的问题。

I installed the ruby-1.9.3-preview1 after updating my rvm by following the steps below:

 » rvm get head
 » rvm reload
 » rvm install ruby-1.9.3-preview1

Then I create a gem set for my project and try to use it.

 » rvm --create ruby-1.9.3@myproject
 » rvm use ruby-1.9.3@myproject

I test it out by:

 » ruby -v                         
ruby 1.9.3dev (2011-07-31 revision 32789) [x86_64-darwin11.1.0]

But then when I try using it:

 » bundle exec rails server
/Users/<home>/.rvm/gems/ruby-1.9.2-p290@envision/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `block in require': iconv will be deprecated in the future, use String#encode instead.
=> Booting WEBrick

it still seems to be using the older version of Ruby. Did anyone else face this issue or am I doing something wrong?

EDIT

I originally intended to install the latest ruby-1.9.3-rc1. I switched to using that, by following the same steps above, and still have the same issue.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

↘人皮目录ツ 2024-12-13 12:55:55

我想我发现了这个问题,它似乎与rvm或ruby-1.9.3完全无关。我的捆绑器配置有问题。我希望这对那些因宝石套装未被使用而感到惊讶的人有所帮助。

所以,

 » bundle config
Settings are listed in order of priority. The top value will be used.

path
  Set for the current user (/Users/<home>/.bundle/config): "/Users/<home>/.rvm/gems/ruby-1.9.2-p290@myproject"

….

这意味着默认情况下它总是使用路径下的 gem set。

 » bundle config path ''

似乎解决了这个问题。我确信有更好的方法可以通过显式删除来删除默认捆绑包配置上的任何配置覆盖。但到目前为止,这有效,我已经使用了 1-.9.3-rc1 的新宝石集。不幸的是,并非所有的 gems 都使用 1.9.3-rc1 进行编译,特别是 gherkin-2.2.9 的问题。如果有人成功了请告诉我。我想这是一个不同的问题。

编辑

 » bundle config path ''

这样做是一个坏主意。我很快就意识到我的错误,因为这将默认直接创建您的宝石集。

 » bundle config path $GEM_HOME

在确保 GEM_HOME 指向 …/ruby-1.9.3-rc1@myproject 后,上面的内容更好。所以是的,我仍然想知道如何让捆绑配置使用默认值,这样我就不必自己更改它。我尝试在 myproject 目录下编辑 .bundle/config 但没有成功。

I think I found the issue, which seems completely unrelated to rvm or ruby-1.9.3. There was a problem with my bundler config. I hope this helps anyone who is surprised by seeing there gem sets not being used.

So,

 » bundle config
Settings are listed in order of priority. The top value will be used.

path
  Set for the current user (/Users/<home>/.bundle/config): "/Users/<home>/.rvm/gems/ruby-1.9.2-p290@myproject"

….

which meant it would always use the gem set under the path by default.

 » bundle config path ''

seems to fix the issue. I am sure there a better way to remove any config overrides on the bundle config default by an explicit remove. But so far this worked and I have my new gem set with 1-.9.3-rc1 being used. Unfortunately not all my gems are compiling with 1.9.3-rc1, specifically an issue with gherkin-2.2.9. Let me know if someone got it work. I guess this a different question.

EDIT

 » bundle config path ''

Doing that is a bad idea. I realized my mistake soon as this will default the current directly for creating your gemset.

 » bundle config path $GEM_HOME

The above is better, after making sure GEM_HOME points to …/ruby-1.9.3-rc1@myproject . So yes I would still like to know how to let bundle config use the defaults so I don't have to change it myself. I tried editing .bundle/config with no luck under the myproject directory.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文