Getting error for libxml2.2.dylib “file is not of required architecture”

这一生的挚爱 提交于 2020-01-14 10:40:50

问题


I'm trying to use rvm to install Ruby 1.9.2 on my Mac running Snow Leopard.

My .bash_profile contains

ARCHFLAGS="-arch x86_64"

To install ruby, I run:

rvm install 1.9.2 -C --enable-shared

I get an error during compiling. Here is the make.error.log:

[2010-01-20 10:03:00] make 
ld: in /usr/local/lib/libxml2.2.dylib, file is not of required architecture
collect2: ld returned 1 exit status
make[1]: *** [../../.ext/i386-darwin10.2.0/tcltklib.bundle] Error 1
make: *** [mkmain.sh] Error 1

EDIT:

I installed readline from source and tried the install like this:

rvm install 1.9.2 -C --enable-shared,--with-readline-dir=/usr/local 

which resulted in the same error as before.

The locations of the rcltklib.bundle file is:

/usr/local/lib/ruby/1.8/i686-darwin9.7.0/tcltklib.bundle  

(I think this file is part of the Ruby OSX installation)


回答1:


Now, finally I figured it out.
I did install ruby 1.8.7 from rubyosx and there seemed to be some broken libraries, which rvm used to compile its rubies.

The solution is to remove the rubyosx ruby from /usr/local.

The less drastic solution is to just rename the /usr/local folder during compiling with rvm. Afterwards you can name it back and it works as expected.

Glad it works now.




回答2:


You are setting ARCHFLAGS to two different architectures. Why? Try with only -arch -x86_64 (which as far as I know, is the default in snow leopard).



来源:https://stackoverflow.com/questions/2100187/getting-error-for-libxml2-2-dylib-file-is-not-of-required-architecture

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!