RVM 似乎不能很好地与 ruby-1.9.3-preview1 配合使用
我按照以下步骤更新我的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想我发现了这个问题,它似乎与rvm或ruby-1.9.3完全无关。我的捆绑器配置有问题。我希望这对那些因宝石套装未被使用而感到惊讶的人有所帮助。
所以,
这意味着默认情况下它总是使用路径下的 gem set。
似乎解决了这个问题。我确信有更好的方法可以通过显式删除来删除默认捆绑包配置上的任何配置覆盖。但到目前为止,这有效,我已经使用了 1-.9.3-rc1 的新宝石集。不幸的是,并非所有的 gems 都使用 1.9.3-rc1 进行编译,特别是 gherkin-2.2.9 的问题。如果有人成功了请告诉我。我想这是一个不同的问题。
编辑
这样做是一个坏主意。我很快就意识到我的错误,因为这将默认直接创建您的宝石集。
在确保 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,
which meant it would always use the gem set under the path by default.
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
Doing that is a bad idea. I realized my mistake soon as this will default the current directly for creating your gemset.
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.