Running:
- Mac OS X Lion 10.7.4
- xCode Version 4.4.1
- Ruby 1.8.x
- Brew
- Rvm
I’m trying to install ruby on rails on my mac (above are my specs). But it doesn’t really come out the way it used to be. I tried several tutorials on the web including Stack Overflow.
As soon as I try:
$ sudo gem install rails
I get this error:
ERROR: Error installing rails: ERROR: Failed to build gem native extension.
Same with Ruby 1.9.2
EDIT
Error for installing ruby
Peter-Corverss-MacBook-Pro:~ Beer$ rvm install ruby-1.9.2-p290
Fetching yaml-0.1.4.tar.gz to /Users/Beer/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /Users/Beer/.rvm/src
Configuring yaml in /Users/Beer/.rvm/src/yaml-0.1.4.
Error running './configure --prefix=/Users/Beer/.rvm/usr', please read /Users/Beer/.rvm/log/ruby-1.9.2-p290/yaml/configure.log
Compiling yaml in /Users/Beer/.rvm/src/yaml-0.1.4.
Error running 'make', please read /Users/Beer/.rvm/log/ruby-1.9.2-p290/yaml/make.log
Installing Ruby from source to: /Users/Beer/.rvm/rubies/ruby-1.9.2-p290, this may take a while depending on your cpu(s)...
ruby-1.9.2-p290 - #downloading ruby-1.9.2-p290, this may take a while depending on your connection...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 8604k 100 8604k 0 0 225k 0 0:00:38 0:00:38 --:--:-- 202k
ruby-1.9.2-p290 - #extracting ruby-1.9.2-p290 to /Users/Beer/.rvm/src/ruby-1.9.2-p290
ruby-1.9.2-p290 - #extracted to /Users/Beer/.rvm/src/ruby-1.9.2-p290
ruby-1.9.2-p290 - #configuring
Error running './configure --prefix=/Users/Beer/.rvm/rubies/ruby-1.9.2-p290 --enable-shared --disable-install-doc --with-libyaml --with-opt-dir=/Users/Beer/.rvm/usr', please read /Users/Beer/.rvm/log/ruby-1.9.2-p290/configure.log
There has been an error while running configure. Halting the installation.
Above code with some color (image):

This is the start for installing ruby and I can’t get it to work.
I really tried but I can’t fix the problem, hope someone could help me.
Yeah if you’re having trouble building ruby, you probably need the command line utilities from Xcode. Checkout: http://developer.apple.com/library/mac/#recipes/xcode_help-documentation_preferences/DownloadingandInstallingXcodeComponents/DownloadingandInstallingXcodeComponents.html
It’s in the preferences pane with a downloads tab.
After that installs, reopen terminal and try to install 1.9.2 through rvm again. If it doesnt install still, please comment and I’ll see if I can figure it out. If it does install, try installing both rails & bundler:
The first line will switch you into 1.9.2 and should set it up as your default environment.