简体   繁体   English

在Lion上安装带有RVM的1.9.3时出错

[英]Error installing 1.9.3 with RVM on Lion

I have burned an embarrassing number of hours trying to install ruby and rails on Mac. 我已经烧掉了一个令人尴尬的数小时试图在Mac上安装ruby和rails。 I am using Lion 10.7.2, Xcode 4.2.1, rvm 1.10.0, and gcc 4.2.1 Does anyone have a surefire way to install ruby with rvm. 我正在使用Lion 10.7.2,Xcode 4.2.1,rvm 1.10.0和gcc 4.2.1有没有人有一个万无一失的方法来安装ruby与rvm。 Or, is there 或者,是吗?

rvm install 1.9.2 -C --with-readline-dir=$rvm_path/usr --with-iconv-dir=$rvm_path/usr

Produces the error 产生错误

make[1]: *** [../../.ext/x86_64-darwin11.2.0/tcltklib.bundle] Error 1
make: *** [mkmain.sh] Error 1

Running 运行

rvm install 1.9.3-p0  --with-gcc=clang  

Produces the error 产生错误

make: *** [.rbconfig.time] Abort trap: 6

Simply running 简单地跑

rvm install 1.9.3

Produces the error 产生错误

make[2]: *** [../../.ext/x86_64-darwin11.2.0/tcltklib.bundle] Error 1
make[1]: *** [ext/tk/all] Error 2
make: *** [build-ext] Error 2

From reading this , I ran the below in the Terminal and my Mac would not restart until I put the libiconv.2.dylib back in place using Target Disk Mode. 从阅读本文开始 ,我在终端中运行了以下内容,直到我使用目标磁盘模式将libiconv.2.dylib放回原位后,我的Mac才会重启。

rm /usr/local/lib/libiconv.2.dylib
ln -s /usr/lib/libiconv.2.dylib /usr/local/lib/libiconv.2.dylib

From this link, I also removed a previous install of Macfuse which is known to cause problems 这个链接,我还删除了以前安装的Macfuse,已知会导致问题

I have reinstalled Xcode twice [Install Xcode from the Application Folder]. 我重新安装了Xcode两次[从应用程序文件夹安装Xcode]。

Is there another way to get Ruby Installed on Lion? 还有另一种方法可以在Lion上安装Ruby吗? Many thanks as I'm fast running out of ideas 非常感谢,因为我快速耗尽了想法
Graham 格雷厄姆

The following worked for me: 以下对我有用:

$ rvm install 1.9.3 --with-gcc=clang

I got that from this page . 我从这个页面得到了。

I had this problem too and tried several of the listed solutions unsuccessfully. 我也有这个问题,并尝试了几个列出的解决方案失败。 Then I downloaded XCode 4.3.1 for Lion and the Xcode command line tools update (dated March 7, 2012) from Apple's developer site and just re-ran 'rvm install 1.9.3'. 然后我从Apple开发者网站下载了XCode 4.3.1 for LionXcode命令行工具更新 (日期为2012年3月7日),并重新运行'rvm install 1.9.3'。 Worked perfectly and installed 1.9.3p125. 完美工作并安装1.9.3p125。

Hope this helps 希望这可以帮助

Note that RVM itself tells you that it won't work with XCode 4.2: 请注意,RVM本身告诉您它不适用于XCode 4.2:

** Lion Users: DO NOT use Xcode Version 4.2.x for OS X Lion. ** Lion用户:不要将Xcode版本4.2.x用于OS X Lion。 It currently fails to build several rubies and gems, as well as several Homebrew and Macports packages as well. 它目前无法构建几个红宝石和宝石,以及几个Homebrew和Macports包。 Xcode Version 4.1 (4B110) works. Xcode版本4.1(4B110)的工作原理。

You can see this warning again by calling rvm requirements . 您可以通过调用rvm requirements再次看到此警告。

The simplest (albeit slow) way to fix the problem is to remove XCode 4.2 and download and install XCode 4.1. 解决问题的最简单(尽管很慢)方法是删除XCode 4.2并下载并安装XCode 4.1。 You can also apparently fix it with a separate gcc-4.2 installation, but I don't know the details of how you'd do that. 您也可以使用单独的gcc-4.2安装来修复它,但我不知道您是如何做到这一点的细节。

For more detail, see the full discussion on the rvm github tracker 有关更多详细信息,请参阅有关rvm github跟踪器完整讨论

I had a similar problem on my 10.7.2 server with Xcode 4.2.1. 我在X.7 4.2.1的10.7.2服务器上遇到了类似的问题。 Installing this stand-alone gcc compiler (sourced from apple), did the trick for me. 安装这个独立的gcc编译器(源自苹果),为我做了诀窍。

You need to force autoconf. 你需要强制autoconf。

rvm install 1.9.3 --force-autoconf rvm install 1.9.3 --force-autoconf

I was finally able to install ruby by using macports and Xcode 4.2.1. 我终于可以使用macports和Xcode 4.2.1安装ruby。 Had to abandon rvm. 不得不放弃rvm。

port install ruby19 +nosuffix

Thanks for all of the answers and help :) 感谢所有的答案和帮助:)

The following worked for me: 以下对我有用:

rvm pkg install iconv
rvm pkg install readline  
rvm remove 1.9.3
rvm install 1.9.3 --with-iconv-dir=$rvm_path/usr --with-readline-dir=$rvm_path/usr

source: http://blog.merjis.com/2011/12/18/rails-3-1-ruby-1-9-3-lion-xcode-4-1/ 来源: http//blog.merjis.com/2011/12/18/rails-3-1-ruby-1-9-3-lion-xcode-4-1/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM