0
votes

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

3

3 Answers

1
votes

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.

0
votes

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.

0
votes

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.