rvm install 1.8.7(雪豹)make.log错误
我正在新的 macbook pro 上使用 rvm 安装 ruby 1.8.7。我的版本是 10.6.8,xcode 是 4.0.2。 RVM 已启动。我可以毫无问题地安装 1.9.2。但是当我尝试 1.8.7 时,我收到一个错误:
ERROR: Error running 'make ', please read /Users/brentw/.rvm/log/ruby-1.8.7-p352/make.log
ERROR: There has been an error while running make. Halting the installation.
在 make.log 文件中,最后几行显示:
ld: warning: ignoring file ../../../libruby.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
compiling win32ole
compiling zlib
making ruby
/usr/bin/gcc-4.2 -arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp -fno-common -pipe -fno-common -DRUBY_EXPORT -L. -arch i386 -arch x86_64 -bind_at_load main.o -lruby -lpthread -ldl -lobjc -o ruby
ld: warning: ignoring file ./libruby.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
Undefined symbols for architecture i386:
"_ruby_init_stack", referenced from:
_main in main.o
"_ruby_init", referenced from:
_main in main.o
"_ruby_options", referenced from:
_main in main.o
"_ruby_run", referenced from:
_main in main.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/ay/aypnf68iFrumAawnjs+96FjhQuk/-Tmp-//cc7BuLDX.out (No such file or directory)
make[1]: *** [ruby] Error 1
make: *** [all] Error 2
我一直在到处搜索,尝试了多种方法,但我似乎无法获取 1.8.7。我尝试了不同的补丁(虽然可能不是全部),尝试安装 ree,安装 rvm readline,尝试“rvm install 1.8.7 -C --with-arch=x86_64, --with-readline-dir=$rvm_path/usr” ...没有运气...
I'm installing ruby 1.8.7 with rvm on a new macbook pro. I'm on 10.6.8 and I have xcode 4.0.2. RVM is up. I can install 1.9.2 with no problems. But when I try 1.8.7 I get an error:
ERROR: Error running 'make ', please read /Users/brentw/.rvm/log/ruby-1.8.7-p352/make.log
ERROR: There has been an error while running make. Halting the installation.
In the make.log file the last few lines read:
ld: warning: ignoring file ../../../libruby.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
compiling win32ole
compiling zlib
making ruby
/usr/bin/gcc-4.2 -arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp -fno-common -pipe -fno-common -DRUBY_EXPORT -L. -arch i386 -arch x86_64 -bind_at_load main.o -lruby -lpthread -ldl -lobjc -o ruby
ld: warning: ignoring file ./libruby.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
Undefined symbols for architecture i386:
"_ruby_init_stack", referenced from:
_main in main.o
"_ruby_init", referenced from:
_main in main.o
"_ruby_options", referenced from:
_main in main.o
"_ruby_run", referenced from:
_main in main.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/ay/aypnf68iFrumAawnjs+96FjhQuk/-Tmp-//cc7BuLDX.out (No such file or directory)
make[1]: *** [ruby] Error 1
make: *** [all] Error 2
I've been searching all over the place, trying multiple things but I can't seem to get 1.8.7 up. I tried different patches (though probably not all), tried installing ree instead, installed rvm readline, tried "rvm install 1.8.7 -C --with-arch=x86_64, --with-readline-dir=$rvm_path/usr"... no luck...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
就我而言,我最终降级到 rvm 1.8.0,并使用 --with-readline-dir 标志来安装 ruby 1.8.7。终于成功了!!感谢您的线索。
In my case, I finally downgraded to rvm 1.8.0 and also used the --with-readline-dir flag to install ruby 1.8.7. It finally worked!! Thanks for the clues.
问题是rvm 1.8.2。您必须回滚到 1.8.0,一切都会按预期工作。
如果您已删除 rvm,请使用以下命令安装 1.8.0:
如果您使用 rvm 1.8.0 并且不需要任何标志来安装它,则不会出现 zlib 错误。
The problem ist rvm 1.8.2. You have to rollback to 1.8.0 and everything will work as expected.
If you have removed rvm, install 1.8.0 with this command:
You won't get the zlib error, if you use rvm 1.8.0 and you don't need any flags to install it.
啊,在这里找到了答案: https://rvm.io/os/darwin/
现在我'当我尝试安装 gems 时遇到 libz 问题..待解决..
ahh, found the answer here: https://rvm.io/os/darwin/
Now I'm getting a libz problem when I try to install gems.. to be solved..
实际上,所要做的就是 rvm get head,它会将您带到 1.8.3,它通过删除意外添加的 -arch i386 到构建过程来解决问题。最重要的是,简单地从 Homebrew 安装 zlib 就可以消除 zlib 问题,
或者如果您使用 rvm 作为“rvm pkg install zlib”安装 zlib,那么您就可以完成
我相信我已经将网站上的文档更新为反映这一点。如果您发现有误,请针对 https://github.com/ 提出问题rvm/rvm-site/issues/ 请,我将非常乐意修复它。
Actually, all that had to be done, was rvm get head which would have taken you to 1.8.3 which solved the issue by removing an accidently added -arch i386 to the build process. On top of that, simply installing zlib from Homebrew would eliminate the zlib issue as well as doing
or if you installed zlib using rvm as 'rvm pkg install zlib' you could then have done
I believe I've updated the documentation on the site to reflect this. If you find that to be in error, please open an Issue against https://github.com/rvm/rvm-site/issues/ please and I will be more than glad to fix it.
这不是一个解决方案,但这就是我遇到这个问题时所做的...
我在这个问题上花了很多时间,我最终自己抓取并编译了 ruby 并使用了另一个名为 rbenv,安装后:
使用 homebrew 安装 readline:
brew install readline
然后下载最新的 ruby 版本,例如 1.9.2-p290:
http://ftp.ruby-lang .org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz
并将其提取到 $HOME/.rbenv/versions/
然后转到:
然后通过执行以下操作构建 ruby 版本:
不要忘记将当前版本设置为:
This is not a solution, but this what I did when I had this...
I have spent on this issue a lot of time, I ended up grapping and compiling ruby my self and using another ruby version manager called rbenv, after installing it:
Install readline using home brew:
brew install readline
then download latest ruby version like 1.9.2-p290:
http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz
and extract it in $HOME/.rbenv/versions/
then go to:
then buid the ruby version by doing the following:
Don't forget to set your current version as: