Question

I'm trying to use RVM to install ruby 1.9.2 on a Lion system with xcode 4.2. I'm new to ruby so I don't understand why this is not working. I'm reading Ruby on Rails 3 Tutorial as my install guide. However, book is not up to date as it relates to Lion. Can anyone point out what's going on and give exact instructions on what I need to do?

Was it helpful?

Solution

If you do a fresh install of Xcode 4.2, it does not come with GCC (it only comes with LLVM GCC). You should download: https://github.com/kennethreitz/osx-gcc-installer to get GCC.

Once Xcode is installed:

  1. Install RVM (http://beginrescueend.com/rvm/install/)
  2. Close terminal, open a new terminal (just in case).
  3. Enter: rvm list known
  4. You can install any of the rubys with: rvm install X (where X is the ruby)
  5. If you're not sure about step 4, just do "rvm install ruby-1.9.2"

I think that'll work...

OTHER TIPS

I don't have that book, but try following the official instructions: http://beginrescueend.com/rvm/install

EDIT: Tried to leave this as a comment to Ngan, but don't know how to format in comments. If that is indeed the issue (you'll know because you will be getting segfaults when you install gems), Xcode still comes with plain gcc, it just uses LLVM GCC by default. You can set the environment variable CC to use plain gcc:

rvm remove 1.8.7 # or whatever version is failing, just in case
CC=/usr/bin/gcc-4.2 rvm install 1.8.7

If you don't mind using homebrew, try this instructions: Installing Rails on OS X Lion with HomeBrew, RVM and Mysql

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top