I have installed XCode 4.5 and command line tools. Then I install the latest RVM. When I try to install ruby1.9.3, I got the following errors. It seems like the C compiler can’t be executed.
chris$ rvm install ruby
No binary rubies available for: downloads/ruby-1.9.3-p327.
Continuing with compilation. Please read ‘rvm mount’ to get more information on binary rubies.
Fetching yaml-0.1.4.tar.gz to /Users/chris/.rvm/archives
Extracting yaml to /Users/chris/.rvm/src/yaml-0.1.4
Configuring yaml in /Users/chris/.rvm/src/yaml-0.1.4.
Error running ‘env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include ./configure –prefix=/Users/chris/.rvm/usr’, please read /Users/chris/.rvm/log/ruby-1.9.3-p327/yaml/configure.log
Compiling yaml in /Users/chris/.rvm/src/yaml-0.1.4.
Installing yaml to /Users/chris/.rvm/usr
Installing Ruby from source to: /Users/chris/.rvm/rubies/ruby-1.9.3-p327, this may take a while depending on your cpu(s)…
ruby-1.9.3-p327 – #downloading ruby-1.9.3-p327, this may take a while depending on your connection…
ruby-1.9.3-p327 – #extracted to /Users/chris/.rvm/src/ruby-1.9.3-p327 (already extracted)
ruby-1.9.3-p327 – #configuring
Error running ‘env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include ./configure –enable-shared –disable-install-doc –prefix=/Users/chris/.rvm/rubies/ruby-1.9.3-p327 –with-opt-dir=/Users/chris/.rvm/usr’, please read /Users/chris/.rvm/log/ruby-1.9.3-p327/configure.log
There has been an error while running configure. Halting the installation.
The content in the log file:
2012-12-17 21:46:44] env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include ./configure –enable-shared –disable-install-doc –prefix=/Users/chris/.rvm/rubies/ruby-1.9.3-p327 –with-opt-dir=/Users/chris/.rvm/usr
checking build system type… x86_64-apple-darwin11.4.2
checking host system type… x86_64-apple-darwin11.4.2
checking target system type… x86_64-apple-darwin11.4.2
checking whether the C compiler works… no
configure: error: in /Users/chris/.rvm/src/ruby-1.9.3-p327′:
configure: error: C compiler cannot create executables
Seeconfig.log’ for more details
Then I have tried to install the GCC on the https://github.com/kennethreitz/osx-gcc-installer . The error still show up.
I have also tried to change the cmd to rvm install 1.9.3 --with-gcc=clang, but got same errors.
Do I need to set up some environment variable? Or do I miss something?
Are the XCode command-line tools installed? I also use homebrew, but have been able to build ruby-1.9.3 from rvm on Lion and (now) Mountain Lion.