安装没有rvm的gem,以root用户身份显示版本的ruby [英] Installing Gems without rvm, as root, with explicit version of ruby

查看:138
本文介绍了安装没有rvm的gem,以root用户身份显示版本的ruby的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经决定摆脱rvm,而且我用我的新版本的ruby 1.9.2编译了一个宝石。宝石需要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.

如何明确告诉宝石使用所述版本的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

希望帮助某人。

这篇关于安装没有rvm的gem,以root用户身份显示版本的ruby的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆