Peter Jeon
Peter Jeon

Reputation: 1

Why did I get this error on Mac OS Lion?

I don't know what is happening but I downloaded Xcode for OS lion and I am stuck

Building native extensions.  This could take a while...
ERROR:  Error installing rails:
    ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/json-1.7.3 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/json-1.7.3/ext/json/ext/parser/gem_make.out
Jung-Hyun-Jeons-MacBook-Pro:~ peterjeon$ rails -v
Rails is not currently installed on this system. To get the latest version, simply type:

$ sudo gem install rails

You can then rerun your "rails" command.

Upvotes: 0

Views: 174

Answers (1)

Samy Dindane
Samy Dindane

Reputation: 18726

I suggest using RVM which a Ruby version manager. And using the Ruby's last version.

Install RVM with this single command line:

curl https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer | bash -s stable

Don't install it as a root (to avoid problems), except if you know what you are doing.

When the installation's complete, install Ruby: rvm install 1.9.3.

And then use the version you installed it as the default one: rvm use 1.9.3 --default.
(if you don't use the --default prefix, you'll have to run the command each time you want to use Ruby).

Hope it helps, good luck!

Upvotes: 1

Related Questions