TL; DR :
$ gem install rubyzip
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /Users/darth/.rvm/gems/ruby-1.9.2-p136/gems/rubyzip-0.9.4/README
现在详细说明。我不确定哪些信息是相关的,所以我只想说出来。
rvm gemset empty
的gemset ,这也失败了,因为一些权限被拒绝错误(是的愚蠢我没写它下)rvm remove 1.9.2
和rvm install 1.9.2
重新安装了Ruby (之后我没有忘记rvm use 1.9.2 --default
。我安装了捆绑包gem install bundle
,然后尝试在我的Rails 3.1.1项目中bundle install
,但以错误结束
Installing rubyzip (0.9.4)
Errno::EPERM: Operation not permitted - /Users/darth/.rvm/gems/ruby-1.9.2-p136/gems/rubyzip-0.9.4/README
An error occured while installing rubyzip (0.9.4), and Bundler cannot continue.
Make sure that `gem install rubyzip -v '0.9.4'` succeeds before bundling.
gem install rubyzip -v '0.9.4'
给出了上述错误
README文件说要通过ruby install.rb
从那里下载源代码并安装,这也会以错误结束
$ ruby install.rb
/Users/darth/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/fileutils.rb:841:in `install': wrong number of arguments (4 for 3) (ArgumentError)
from install.rb:21:in `block in <main>'
from install.rb:18:in `each'
from install.rb:18:in `<main>'
即使执行rubyzip测试也会出现错误
$ rake test
rake/gempackagetask is deprecated. Use rubygems/package_task instead
rake/rdoctask is deprecated. Use rdoc/task instead (in RDoc 2.4.2+)
/Users/darth/.rvm/rubies/ruby-1.9.2-p136/bin/ruby -C test alltests.rb
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- stdrubyexttest (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require'
from alltests.rb:5:in `<main>'
rake aborted!
Command failed with status (1): [/Users/darth/.rvm/rubies/ruby-1.9.2-p136/b...]
Tasks: TOP => test
(See full trace by running task with --trace)
答案 0 :(得分:2)
我真的不确定是什么导致这种情况,但我设法通过执行以下操作来修复它。
由于重新安装Ruby 1.9.2没有帮助,我决定更加苛刻,然后转到rvm。我发现我安装了1.1.something版本,大约9个月了。
我尝试更新,但没有帮助,所以rvm implode
做了伎俩。我甚至不得不sudo rm -rf ~/.rvm
,可能是因为我设法通过向他们添加sudo
来搞乱一些gem安装。
重新安装rvm
并重新安装1.9.2之后,现在看来一切正常,即使使用Xcode 4.2。
经验教训,rm -rf
&amp;重新安装比尝试从一年前的版本升级更好:)