以 root 身份安装没有 rvm 的 Gems,使用显式版本的 ruby [英] Installing Gems without rvm, as root, with explicit version of ruby
问题描述
我决定摆脱 rvm,但我在使用新版本的 ruby 1.9.2 编译 gem 时遇到了麻烦.gem 需要 1.9.2,我有,但说没有它就无法安装,所以错误消息没有意义.
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.
如何明确告诉 gem 用上述版本的 ruby 进行编译?
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
推荐答案
在 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:
rbenv install 1.9.2-p290 --with-openssl-dir=/usr/local
rbenv rehash
rbenv global 1.9.2-p290
现在,您可以运行或捆绑它,它会正常安装:
Now, you can run or bundle this and it'll install fine:
gem install ruby-debug19
希望对某人有所帮助.
这篇关于以 root 身份安装没有 rvm 的 Gems,使用显式版本的 ruby的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!