Error installing 1.9.3 with RVM on Lion

2019-06-21 18:46发布

问题:

I have burned an embarrassing number of hours trying to install ruby and rails on Mac. 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. 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.

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

I have reinstalled Xcode twice [Install Xcode from the Application Folder].

Is there another way to get Ruby Installed on Lion? Many thanks as I'm fast running out of ideas
Graham

回答1:

The following worked for me:

$ rvm install 1.9.3 --with-gcc=clang

I got that from this page.



回答2:

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'. Worked perfectly and installed 1.9.3p125.

Hope this helps



回答3:

Note that RVM itself tells you that it won't work with XCode 4.2:

** Lion Users: DO NOT use Xcode Version 4.2.x for OS X Lion. It currently fails to build several rubies and gems, as well as several Homebrew and Macports packages as well. Xcode Version 4.1 (4B110) works.

You can see this warning again by calling rvm requirements.

The simplest (albeit slow) way to fix the problem is to remove XCode 4.2 and download and install 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.

For more detail, see the full discussion on the rvm github tracker



回答4:

I had a similar problem on my 10.7.2 server with Xcode 4.2.1. Installing this stand-alone gcc compiler (sourced from apple), did the trick for me.



回答5:

You need to force autoconf.

rvm install 1.9.3 --force-autoconf



回答6:

I was finally able to install ruby by using macports and Xcode 4.2.1. Had to abandon rvm.

port install ruby19 +nosuffix

Thanks for all of the answers and help :)



回答7:

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/