RVM无法在Lion上安装Ruby 1.9.3:libxml2.2.dylib

时间:2012-07-22 15:48:37

标签: ruby osx-lion rvm clang ruby-1.9.3

我继续在堆栈溢出和其他站点读取大量这些线程,这是为什么每个人都无法安装1.9.2或1.9.3的不同原因,但过去一周他们都没有帮助我。所以我的最后一个资源就是制作我自己的主题!

安装时,我会收到以下信息:

Pablos-MacBook-Pro:~ Pablo$ rvm install ruby-1.9.3-p194
Installing Ruby from source to: /Users/Pablo/.rvm/rubies/ruby-1.9.3-p194, this may take a while depending on your cpu(s)...

ruby-1.9.3-p194 - #downloading ruby-1.9.3-p194, this may take a while depending on your connection...
ruby-1.9.3-p194 - #extracted to /Users/Pablo/.rvm/src/ruby-1.9.3-p194 (already extracted)
ruby-1.9.3-p194 - #configuring 
ruby-1.9.3-p194 - #compiling 
Error running 'make ', please read /Users/Pablo/.rvm/log/ruby-1.9.3-p194/make.log
There has been an error while running make. Halting the installation.

/ruby-1.9.3-p194/make.log 以下结尾:

installing default syslog libraries
linking shared-object tcltklib.bundle
ld: in /usr/local/lib/libxml2.2.dylib, file was built for unsupported file format which is not the architecture being linked (x86_64) for architecture x86_64
collect2: ld returned 1 exit status
make[2]: *** [../../.ext/x86_64-darwin11.4.0/tcltklib.bundle] Error 1
make[1]: *** [ext/tk/all] Error 2
make: *** [build-ext] Error 2

可以发生什么事?我已经提前回答了一些问题,因为我现在已经阅读了这么多文章。

  • 我正在运行Mac OS X Lion
  • 我正在运行(我认为是)最新的Xcode版本:4.3.3
  • 我尝试过这样做: CC = / usr / local / bin / gcc-4.2 rvm install 1.9.3
  • 我尝试使用clang: rvm install 1.9.3 --with-gcc = clang ,它失败并出现相同的错误,并且它抛出了一个: clang:错误:不支持的选项' - 与-libyaml'
  • 我可以安装1.8.x版本,但在1.9.2和1.9.3版本中出现相同的错误。

所以,我们在这里得到了一个很好的谜题。有什么想法吗?

谢谢!

1 个答案:

答案 0 :(得分:0)

也许libxml是32位构建的,不能用于构建64位ruby,你可以用以下方法验证它:

file /usr/local/lib/libxml2.2.dylib

如果是这种情况,则需要重新安装并支持64位