6
votes

I'm running OS X Mavericks 10.9 beta and now is a good time to get back to learning Ruby on Rails. Happy to know that 10.9 includes Ruby 2.0

But I'm having trouble installing Rails.

using the command - sudo gem install rails

results in this..

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/2.0/usr/bin/ruby extconf.rb mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/include/ruby.h

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/atomic-1.1.10 for inspection. Results logged to /Library/Ruby/Gems/2.0.0/gems/atomic-1.1.10/ext/gem_make.out

Any advice?

Thanks

Shannon

4
You may brew install ruby-build if you use Homebrew.Mike Szyndel
Do you have Xcode and the command line tools installed?Andy
10.9 changed the place for command line tools, it now in /Developer and managed by the system, when installing rails, it's still searching for command line tool in the Xcode. So, you can get a Xcode4, switch to it and install... no problem at all.Kyle Fang

4 Answers

2
votes

For me this problem was fixed by running the following command:

xcode-select --install
0
votes

Try this post

It's not recommended to use your system Ruby, you can use it in a sandbox like RVM or rbenv.

0
votes

Xcode 5 is required.

and ..

$ xcode-select -p
/Applications/Xcode5-DP3.app/Contents/Developer

it's work .

or

see Install Ruby 2.0 on Mac OS X without RVM

0
votes

Make sure you're using Xcode 5.0.1 GM seed, not the Xcode downloaded from the App Store. That fixed a similar problem for me.