Reputation: 614
I get this error when I try to install Rails on my Mac OS Lion. I used the command - $ sudo gem install rails
/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
Any steps I need to follow to install rails?
Thanks
Upvotes: 0
Views: 398
Reputation: 5761
The system Ruby in Mac OS is outdated, I recommend to you install RVM or Rbenv to manage your installed Rubies or to install new versions.
Upvotes: 0
Reputation: 15516
It looks like you're missing some header files - try reinstalling XCode and the developer tools. If you already downloaded XCode, make sure you've run the installer that it put into /Applications for you.
Like Jack says, using rvm will be a lot smoother.
Upvotes: 0
Reputation: 133577
Just avoid using the bundled ruby, which is 1.8 and it is really outdated. Install rvm which will provide an up-to-date ruby version and then everything will work seamlessly. This is the only thing you need to start:
$ curl -L https://get.rvm.io | bash -s stable --rails
You will need the gcc/g++ toolchain (Xcode) to build everything but you would have needed it in anycase to compile any native gem.
Upvotes: 1