以 root 身份在不使用 rvm 的情况下使用 ruby 的显式版本安装 Gems
我决定放弃 rvm,但我在使用新版本的 ruby 1.9.2 编译 gem 时遇到了麻烦。 gem 需要 1.9.2,我有它,但说没有它就无法安装,所以错误消息没有意义。
我如何明确告诉 gem 使用所述版本的 ruby 进行编译?
Gem::InstallError: linecache19 requires Ruby version >= 1.9.2.
An error occured while installing linecache19 (0.5.12), and Bundler cannot continue.
Make sure that `gem install linecache19 -v '0.5.12'` succeeds before bundling.
apps2 ~/projects/sms/apps2/apps2_admin $ ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.8.0]
apps2 ~/projects/sms/apps2/apps2_admin $ which ruby
/usr/local/bin/ruby
I've decided to get rid of rvm, and I'm having trouble compiling a gem with my new version of ruby 1.9.2. The gem requires 1.9.2, I have it, yet says it can't install without, so the error messages makes no sense.
How can I explicitly tell the gem to compile with said version of ruby?
Gem::InstallError: linecache19 requires Ruby version >= 1.9.2.
An error occured while installing linecache19 (0.5.12), and Bundler cannot continue.
Make sure that `gem install linecache19 -v '0.5.12'` succeeds before bundling.
apps2 ~/projects/sms/apps2/apps2_admin $ ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.8.0]
apps2 ~/projects/sms/apps2/apps2_admin $ which ruby
/usr/local/bin/ruby
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我遇到了类似的问题,并追溯到该问题并解决如下:
问题的根源是在 gem installer.rb 文件中,从 linecache19 传递的所需 ruby 版本是 1.9.2,而 Gem.ruby_version 类似于 1.9 .2.dev.30909,并且 ("1.9.2" >= "1.9.2.dev.30909") 为假。
所以首先要确保 ruby 版本是 1.9.2:
然后手动使用 --force 绕过版本检查:
如果您遇到以以下行开头的另一个错误:
您必须显式地将源路径设置为 vm_core.h
在我的情况下:
所以要安装 linecache19 :
ruby-debug19 有类似的问题:
仅此而已!
I had a similar issue and traced back the issue and solved it as follows:
The root of the issue is that in the gem installer.rb file the passed required ruby version from linecache19 is 1.9.2 while the Gem.ruby_version is something like 1.9.2.dev.30909, and ("1.9.2" >= "1.9.2.dev.30909") is false.
so first become sure that ruby version is 1.9.2:
then manually use --force to bypass version check:
if you faced with another error starting with following lines:
You have to explicitly set the source path to vm_core.h
In my case:
so to install linecache19 :
ruby-debug19 has a similar issue:
That's all!
在 OS X Lion 上使用 rbenv 时,我遇到了同样的问题(linecache19 永远/无限期地挂起)。我发现解决方案是使用 OpenSSL 选项安装 Ruby,如下所示:
现在,您可以运行或捆绑它,它会安装得很好:
希望对某人有所帮助。
I had the same issue (linecache19 hangs forever/indefinitely) when using rbenv on OS X Lion. I found the solution was to install Ruby with OpenSSL option, like this:
Now, you can run or bundle this and it'll install fine:
Hope that helps someone.
这就是 Ubuntu 上的工作原理:
在遇到这个问题之前,我遇到了同样的问题并尝试了很多选择:
http://beginrescueend.com/packages/openssl/
这解决了 linecache19 rubydebug-19 和openssl:
那么你可以做
This is what worked on Ubuntu:
I had the same problems and tried so many options before I came across this:
http://beginrescueend.com/packages/openssl/
This resolves the issue with linecache19 rubydebug-19 and openssl:
then you can do