现在跌跌撞撞。这是我一直在犯的错误(我最近将我的OSX从Leopard升级到Snow Leopard):
redacted's Mac[~]$ rvm install 1.9.3
Fetching yaml-0.1.4.tar.gz to /Users/redacted/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /Users/redacted/.rvm/src
Configuring yaml in /Users/redacted/.rvm/src/yaml-0.1.4.
Compiling yaml in /Users/redacted/.rvm/src/yaml-0.1.4.
Installing yaml to /Users/redacted/.rvm/usr
Installing Ruby from source to: /Users/redacted/.rvm/rubies/ruby-1.9.3-p125, this may take a while depending on your cpu(s)...
ruby-1.9.3-p125 - #fetching
ruby-1.9.3-p125 - #extracted to /Users/redacted/.rvm/src/ruby-1.9.3-p125 (already extracted)
ruby-1.9.3-p125 - #configuring
ruby-1.9.3-p125 - #compiling
Error running 'make ', please read /Users/redacted/.rvm/log/ruby-1.9.3-p125/make.log
There has been an error while running make. Halting the installation.
查看日志,有:
ld: in /usr/local/lib/libxml2.2.dylib, file was built for i386 which is not the architecture being linked (x86_64)
Google搜索并搜索了此网站,并遵循了一些建议,包括:
1)将XCode更新为3.2.6(我在Snow Leopard上)。这与安装DVD上的Xcode版本不同。
2)完全删除MacPorts的所有痕迹(按此处http://www.libertypages.com/clarktech/?p=743执行),包括删除我之前的MacPort内容的/ opt / local
3)完全删除所有RVM痕迹(按此处How can I remove RVM (Ruby Version Manager) from my system?}
4)为Snow Leopard安装MacPorts,并运行sudo port -v selfupdate
5)sudo port install libxml2 libxslt(我确认它似乎是在使用x86_64架构 - 这里是libxml2的样子:
---> Computing dependencies for libxml2
---> Dependencies to be installed: zlib
---> Fetching archive for zlib
---> Attempting to fetch zlib-1.2.6_0.darwin_10.x86_64.tbz2 from http://packages.macports.org/zlib
---> Attempting to fetch zlib-1.2.6_0.darwin_10.x86_64.tbz2.rmd160 from http://packages.macports.org/zlib
---> Installing zlib @1.2.6_0
---> Activating zlib @1.2.6_0
---> Cleaning zlib
---> Fetching archive for libxml2
---> Attempting to fetch libxml2-2.7.8_0.darwin_10.x86_64.tbz2 from http://packages.macports.org/libxml2
---> Attempting to fetch libxml2-2.7.8_0.darwin_10.x86_64.tbz2.rmd160 from http://packages.macports.org/libxml2
---> Installing libxml2 @2.7.8_0
---> Activating libxml2 @2.7.8_0
---> Cleaning libxml2
6)安装RVM
7)此时,我的库文件,RVM,MacPorts,XCode似乎是最新且正确的架构
8)rvm install 1.8.7成功
9)rvm install 1.9.2和1.9.3失败,错误消息显示在此问题的开头。
我错过了哪些想法?我在阅读文章时尝试各种各样的事情时注意到了这一点:
file /usr/local/lib/libxml2.2.dylib
/usr/local/lib/libxml2.2.dylib: Mach-O dynamically linked shared library i386
不确定这是否有意义。奇怪的是,当MacPorts似乎安装了x86_64版本时,它仍然认为libxml2是i386。
- >我发布之后大约21分钟编辑 - 实际上,我认为macport文件为64位我相信,所以当rvm尝试安装1.9.2 / 1.9.3时,库文件路径设置错误是可能的? (见下文)
file /opt/local/lib/libxml2.2.dylib
/opt/local/lib/libxml2.2.dylib: Mach-O 64-bit dynamically linked shared library x86_64
这是我的路径:
redacted's Mac[~]$ echo $PATH
/opt/local/bin:/opt/local/sbin:/usr/local/mysql/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:/Users/redacted/.rvm/bin
rvm info:
system:
system:
uname: "Darwin redacted-macbook-pro.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386"
bash: "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)"
zsh: "/bin/zsh => zsh 4.3.9 (i386-apple-darwin10.0)"
rvm:
version: "rvm 1.10.3 by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.beginrescueend.com/]"
updated: "3 hours 26 minutes 47 seconds ago"
homes:
gem: "not set"
ruby: "not set"
binaries:
ruby: "/usr/local/bin/ruby"
irb: "/usr/local/bin/irb"
gem: "/usr/local/bin/gem"
rake: "/usr/local/bin/rake"
environment:
PATH: "/opt/local/bin:/opt/local/sbin:/usr/local/mysql/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:/Users/redacted/.rvm/bin"
GEM_HOME: ""
GEM_PATH: ""
MY_RUBY_HOME: ""
IRBRC: ""
RUBYOPT: ""
gemset: ""
不知道如何继续这一点;我基本上已经卸载并重新安装了两次都无济于事。
- &GT;编辑:为史蒂夫添加此内容
[2012-02-24 22:54:41] make
CC = /usr/bin/gcc-4.2
LD = ld
LDSHARED = /usr/bin/gcc-4.2 -dynamiclib
CFLAGS = -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=shorten-64-to-32 -Werror=implicit-function-declaration -fno-common -pipe
XCFLAGS = -include ruby/config.h -include ruby/missing.h -fvisibility=hidden -DRUBY_EXPORT
CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I. -I.ext/include/x86_64-darwin10.8.0 -I./include -I.
DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -Wl,-flat_namespace -install_name /Users/craigflannagan/.rvm/rubies/ruby-1.9.3-p125/lib/libruby.1.9.1.dylib -current_version 1.9.1 -compatibility_version 1.9.1 -Wl,-unexported_symbol,_Init_* -Wl,-unexported_symbol,*_threadptr_* -Wl,-u,_objc_msgSend
SOLIBS =
linking miniruby
rbconfig.rb unchanged
generating enc.mk
generating prelude.c
compiling prelude.c
linking static-library libruby.1.9.1-static.a
linking shared-library libruby.1.9.1.dylib
generating encdb.h
encdb.h unchanged
making enc
make[1]: Nothing to be done for `enc'.
making srcs under enc
make[1]: Nothing to be done for `srcs'.
generating transdb.h
transdb.h unchanged
making trans
make[1]: Nothing to be done for `./enc/trans'.
making encs
installing default bug libraries
installing default resize libraries
installing default bug libraries
installing default bug libraries
installing default funcall libraries
installing default dot.dot libraries
installing default old_thread_select libraries
installing default numhash libraries
installing default string libraries
installing default wait_for_single_fd libraries
installing default bigdecimal libraries
installing default continuation libraries
installing default coverage libraries
installing default curses libraries
installing default date_core libraries
make[2]: Nothing to be done for `all'.
installing digest libraries
installing default digest libraries
installing default bubblebabble libraries
installing default md5 libraries
installing default rmd160 libraries
installing default sha1 libraries
installing default sha2 libraries
installing dl libraries
installing default dl libraries
installing default callback libraries
make[2]: Nothing to be done for `all'.
installing default etc libraries
installing default fcntl libraries
installing default fiber libraries
installing default fiddle libraries
make[2]: Nothing to be done for `all'.
installing default iconv libraries
installing default console libraries
installing default nonblock libraries
installing default wait libraries
installing default libraries
installing default generator libraries
installing default parser libraries
installing default complex libraries
installing default rational libraries
installing default nkf libraries
installing default objspace libraries
installing default openssl libraries
installing default pathname libraries
installing default psych libraries
installing default pty libraries
installing default cparse libraries
installing default readline libraries
installing default ripper libraries
checking ../.././parse.y and ../.././ext/ripper/eventids2.c
installing default sdbm libraries
installing default socket libraries
installing default stringio libraries
installing default strscan libraries
installing default syck libraries
installing default syslog libraries
linking shared-object tcltklib.bundle
ld: in /usr/local/lib/libxml2.2.dylib, file was built for i386 which is not the architecture being linked (x86_64)
collect2: ld returned 1 exit status
make[2]: *** [../../.ext/x86_64-darwin10.8.0/tcltklib.bundle] Error 1
make[1]: *** [ext/tk/all] Error 2
make: *** [build-ext] Error 2
答案 0 :(得分:0)
问题是您只设置 PATH 变量。但是,此环境变量不用于查找共享库。您需要设置 DYLD_LIBRARY_PATH 环境变量。另请查看' man dyld '。
答案 1 :(得分:0)
您需要更新以删除旧的Xcode并安装Xcode 4.1或使用osx-gcc-installer
请阅读rvm requirements
,了解正确安装ruby所需的详细信息