Rbenv:无法安装2.2.0或2.2.1。在2.2.2(OSX 10.10.4)上无法“gem install bundler”

时间:2015-07-06 01:33:24

标签: ruby-on-rails ruby macos bundler rbenv

在我试图找到解决其他问题的方法时,我感到很沮丧,只是用library(lattice) library(gridExtra) # for grid.arrange() p1 <- levelplot(t(apply(matrix(newdat[,1], 2, 4, byrow=TRUE), 1, rev))) p2 <- levelplot(t(apply(matrix(newdat[,2], 2, 4, byrow=TRUE), 1, rev))) p3 <- levelplot(t(apply(matrix(newdat[,3], 2, 4, byrow=TRUE), 1, rev))) grid.arrange(p1, p2, p3, ncol=3) # Or in a loop: p <- apply(newdat, 2, function(i) levelplot(t(apply(matrix(i, 2, 4, byrow=TRUE), 1, rev)))) grid.arrange(p[[1]], p[[2]], p[[3]], ncol=length(p)) 删除了我的Ruby安装。用rm -rf ~/.rbenv/versions/2.2.2重新安装后,我发现突然间我无法安装rbenv install 2.2.2宝石。 bundler命令导致以下错误:

gem install bundler

我读过的所有内容似乎表明缺少ERROR: Loading command: install (LoadError) cannot load such file -- zlib ERROR: While executing gem ... (NoMethodError) undefined method `invoke_with_build_args' for nil:NilClass 包通常是Linux系统的问题。但是,我正在使用OSX 10.10.4并且我已经读过zlib应该带有命令行工具,我有。

经过一堆谷歌搜索并没有进展后,我决定重新开始使用rbenv。我卸载了rbenv并重新安装了它,但我仍然无法使用我的rbenv安装ruby 2.2.2安装bundler。更重要的是,我发现我根本无法安装版本2.2.0或2.2.1:

zlib

我完全没有想法,如果有人认为他们可能知道发生了什么,我会感激任何帮助。在这一点上,我的开发环境几乎完全被淹没了。

修改

运行MacBook-Pro:~ me$ rbenv install 2.2.0 Downloading ruby-2.2.0.tar.gz... -> http://dqw8nmjcqpjn7.cloudfront.net/7671e394abfb5d262fbcd3b27a71bf78737c7e9347fa21c39e58b0bb9c4840fc Installing ruby-2.2.0... BUILD FAILED (OS X 10.10.4 using ruby-build 20150519) Inspect or clean up the working tree at /var/folders/rm/38vbv5g952s54r1txrmrdlf40000gn/T/ruby-build.20150705212307.49958 Results logged to /var/folders/rm/38vbv5g952s54r1txrmrdlf40000gn/T/ruby-build.20150705212307.49958.log Last 10 log lines: from /private/var/folders/rm/38vbv5g952s54r1txrmrdlf40000gn/T/ruby-build.20150705212307.49958/ruby-2.2.0/lib/rubygems/core_ext/kernel_require.rb:54:in `require' from /private/var/folders/rm/38vbv5g952s54r1txrmrdlf40000gn/T/ruby-build.20150705212307.49958/ruby-2.2.0/lib/rubygems.rb:556:in `install' from ./tool/rbinstall.rb:717:in `block (2 levels) in <main>' from ./tool/rbinstall.rb:716:in `each' from ./tool/rbinstall.rb:716:in `block in <main>' from ./tool/rbinstall.rb:749:in `call' from ./tool/rbinstall.rb:749:in `block in <main>' from ./tool/rbinstall.rb:746:in `each' from ./tool/rbinstall.rb:746:in `<main>' make: *** [do-install-all] Error 1 的输出:

brew doctor

1 个答案:

答案 0 :(得分:0)

事实证明,a)我的Xcode安装发生了什么(不确定它会发生什么/怎么发生)或b)升级OSX后升级后需要手动更新Xcode。

即使我升级了命令行工具,我决定在App Store中检查我的Xcode安装,并注意到可以安装/更新。所以我做到了,然后一切正常。