- Ruby 1.9.3
- RVM 1.10.0
- Mac OSX 10.7.2
- XCode 4.2
Our team ran into an issue installing Ruby 1.9.3 on Lion today. When running…
$ rvm install ruby-1.9.3
… the installer fails with an error message including “checking whether the C compiler works… no” even though we had XCode and gcc installed.
After some reading on StackOverflow and Github I found this solution [1]…
$ rvm install 1.9.3-p0 --with-gcc=clang
… which points an explanation on RVM’s issue tracker [2].
- http://stackoverflow.com/questions/8675194/error-installing-1-9-3-with-rvm-on-lion
- https://github.com/wayneeseguin/rvm/issues/534
See our full command line history and error messages below:
$ rvm install ruby-1.9.3-p0
Installing Ruby from source to: /Users/foobar/.rvm/rubies/ruby-1.9.3-p0, this may take a while depending on your cpu(s)...
ruby-1.9.3-p0 - #fetching
ruby-1.9.3-p0 - #extracted to /Users/foobar/.rvm/src/ruby-1.9.3-p0 (already extracted)
Fetching yaml-0.1.4.tar.gz to /Users/foobar/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /Users/foobar/.rvm/src
Configuring yaml in /Users/foobar/.rvm/src/yaml-0.1.4.
Compiling yaml in /Users/foobar/.rvm/src/yaml-0.1.4.
Installing yaml to /Users/foobar/.rvm/usr
ruby-1.9.3-p0 - #configuring
ERROR: Error running ' ./configure -- prefix=/Users/foobar/.rvm/rubies/ruby-1.9.3-p0 --enable- shared --disable-install-doc --with-libyaml- dir=/Users/foobar/.rvm/usr ', please read /Users/foobar/.rvm/log/ruby-1.9.3-p0/configure.log
ERROR: There has been an error while running configure. Halting the installation.
$ cat /Users/foobar/.rvm/log/ruby-1.9.3-p0/configure.log
[2012-01-13 10:31:49] ./configure -- prefix=/Users/foobar/.rvm/rubies/ruby-1.9.3-p0 --enable-shared --disable-install-doc --with-libyaml- dir=/Users/foobar/.rvm/usr
configure: WARNING: unrecognized options: --with-libyaml-dir
checking build system type... x86_64-apple-darwin11.2.0
checking host system type... x86_64-apple-darwin11.2.0
checking target system type... x86_64-apple-darwin11.2.0
checking whether the C compiler works... no
configure: error: in `/Users/foobar/.rvm/src/ruby-1.9.3-p0':
configure: error: C compiler cannot create executables
See `config.log' for more details
Ran into the same issue recently :)
Try installing readline & yaml via rvm first and giving it another whirl…
rvm pkg install libyaml
rvm pkg install readline
rvm install 1.9.3 –with-gcc=clang –with-readline-dir=/Users/scott/.rvm/usr –with-libyaml-dir=/Users/scott/.rvm/usr
January 13, 2012 at 8:27 am
1. Uninstall/remove all traces of manually installed old ruby versions and extras (e.g. sqlite3, libxml2-x.x.x, libxslt-x.x.x) from your /usr/local/ or wherever you installed them.
2. Download and install JewlryBox http://unfiniti.com/software/mac/jewelrybox which is a RVM GUI interface for managing your rubies and gemsets.
3. In JewlryBox, click “Add Ruby” and choose the version of ruby you want to install (I chose 64 bit, Enabled Shared and didn’t check/tick the “Use clang” option).
Worked with OS X Lion 10.7.3 and Xcode 4.3 Command Line Tools installed.
February 27, 2012 at 1:40 pm