2

I'm trying to install Ruby 1.9.3-p385 on my work machine using Mountain Lion.

I've installed RVM and run

rvm install 1.9.3

But I get this error...

Error running 'env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include ./configure --disable-install-doc --prefix=/usr/local/rvm/rubies/ruby-1.9.3-p385 --with-opt-dir=/usr/local/rvm/usr --disable-shared', please read /usr/local/rvm/log/ruby-1.9.3-p385/configure.log
There has been an error while running configure. Halting the installation.

This is the contents of configure.log that the error points to...

[2013-02-18 10:10:50] ./configure
checking build system type... x86_64-apple-darwin12.2.1
checking host system type... x86_64-apple-darwin12.2.1
checking target system type... x86_64-apple-darwin12.2.1
checking whether the C compiler works... no
configure: error: in `/usr/local/rvm/src/ruby-1.9.3-p385':
configure: error: C compiler cannot create executables
See `config.log' for more details

It's all a bit cryptic to me. If anyone can help it would be appreciated.

markstewie
  • 9,237
  • 10
  • 50
  • 72
  • possible duplicate of [Error installing Ruby with RVM (OSX 10.8)](http://stackoverflow.com/questions/14072524/error-installing-ruby-with-rvm-osx-10-8) – mpapis Feb 17 '13 at 22:19

2 Answers2

2

This is problem with railsinstaller default settings, check this answer https://stackoverflow.com/a/12929017/497756

Community
  • 1
  • 1
mpapis
  • 52,729
  • 14
  • 121
  • 158
0

See this question and my answer.

To sum up, install MacPorts and run:

sudo port selfupdate
sudo port install gcc-apple42
CC=/opt/local/bin/gcc-apple-4.2 rvm install ruby-1.9.3-p194 --enable-shared --without-tk --without-tcl
Community
  • 1
  • 1
Linuxios
  • 34,849
  • 13
  • 91
  • 116
  • I use homebrew, but have used that to install gcc-apple42. But... still getting same errors :( – markstewie Feb 17 '13 at 22:20
  • that's different problem, it's because of /etc/rvmrc installed by RailsInstaller - it has bug in quoting environment, btw. would you be interested in adding automated support for MacPorts in RVM? => https://github.com/wayneeseguin/rvm/pull/1544 – mpapis Feb 17 '13 at 22:23
  • @markstewie: Change `/opt/local` to `/usr/local`. then remove your downvote. – Linuxios Feb 17 '13 at 22:25
  • Sorry @Linuxios didn't mean to downvote.. anyhow changed to CC=/usr/local/bin/gcc-4.2 rvm install ruby-1.9.3 --enable-shared --without-tk --without-tcl and still get the same error. – markstewie Feb 17 '13 at 22:31
  • it does not help because it's not the fix,, here is the proper fix http://stackoverflow.com/a/12929017/497756 – mpapis Feb 17 '13 at 23:04