Sunday, February 24, 2013

Installing Ruby Version Manager (rvm) on Mac

It's always annoying when things don't "just work" and I ran in to it recently trying to install rvm on my iMac, running Mountain Lion. RVM is a great tool to manager different ruby versions installed on the same computer and the rvm home page has lots of great information. For Linux and Macs it states to run this command:

curl -L https://get.rvm.io | bash -s stable --ruby

The gave me a number of errors, including the following:


Error running './configure --prefix=/Users/bwright/.rvm/usr --disable-shared', please read /Users/bwright/.rvm/log/ruby-2.0.0-p0/yaml/configure.log
Error running 'make -j2', please read /Users/bwright/.rvm/log/ruby-2.0.0-p0/yaml/make.log
Error running 'make', please read /Users/bwright/.rvm/log/ruby-2.0.0-p0/openssl/make.log
Error running 'update_openssl_certs', please read /Users/bwright/.rvm/log/ruby-2.0.0-p0/openssl.certs.log
Error running './configure --disable-install-doc --prefix=/Users/bwright/.rvm/rubies/ruby-2.0.0-p0 --with-opt-dir=/Users/bwright/.rvm/usr:/Users/bwright/.rvm/usr --disable-shared', please read /Users/bwright/.rvm/log/ruby-2.0.0-p0/configure.log
There has been an error while running configure. Halting the installation.

I investigated the first log file and found:

no acceptable C compiler found in $PATH

That you need a C compiler is not mentioned anywhere on the rvm site and that is annoying, but the solution was such that I don't feel the omission was nearly as bad. It turns out that you need to install the command line tools from the XCode development environment, which is the native Mac development environment for OSX and for iOS. If you are programming with Ruby it is highly likely that you might have installed these programming tools as well. Unfortunately, just installing XCode isn't enough. You have to manually install the command line tools. This is described in many places on the web, including here, but it is simple: just open XCode preferences, select Downloads and install the tools.

Once this was done, the installation of rvm did indeed "just work."

1 Comments:

Blogger Unknown said...

I almost gave up until I found this post. This did the trick: curl -L https://get.rvm.io | bash -s stable --ruby

March 1, 2013 at 10:56 AM  

Post a Comment

Subscribe to Post Comments [Atom]

<< Home