[英]Cannot install watir on ruby 2.0 because of rubyzip
I'm trying to install watir. 我正在尝试安装watir。 Had to upgrade my ruby installation so I installed rvenv and then used it to install ruby v2.0.
必须升级我的ruby安装,所以我安装了rvenv,然后用它来安装ruby v2.0。
Sagis-MacBook-Air:~ sagism$ rbenv shell 2.0.0-rc2
Sagis-MacBook-Air:~ sagism$ ruby -v
ruby 2.0.0dev (2013-02-08 trunk 39161) [x86_64-darwin11.4.2]
Sagis-MacBook-Air:~ sagism$ sudo gem install watir
ERROR: Error installing watir:
rubyzip requires Ruby version >= 1.9.2.
I tried to install ruby 1.9.4 but then I get another error which I cannot resolve (different issue). 我尝试安装ruby 1.9.4,但随后出现另一个我无法解决的错误(不同的问题)。
Make sure that you ruby environment isn't dropped by sudo
command: 确保您的ruby环境没有被
sudo
命令删除:
$ sudo ruby -v
ruby 2.0.0dev (2013-02-08 trunk 39161) [x86_64-darwin11.4.2]
If your environment has reset: 如果您的环境已重置:
$ sudo ruby -v
ruby 1.8.7 [x86_64-darwin11.4.2]
Add into /etc/sudoers
string like follows, and be sure that you are in wheel
group: 如下所示添加到
/etc/sudoers
字符串中,并确保您属于wheel
组:
User_Alias WHEEL_USERS = %wheel
Defaults:WHEEL_USERS !env_reset
Of course you can do it for any group you wish, this should prevent to drop the current environment, when you have to sudo
, then try again: 当然,您可以对任何组执行此操作,这应该避免在必须执行
sudo
时删除当前环境,然后重试:
$ sudo ruby -v
ruby 2.0.0dev (2013-02-08 trunk 39161) [x86_64-darwin11.4.2]
sudo update-alternatives --config gem
sudo update-alternatives --config宝石
and select the correct version 然后选择正确的版本
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.