1
votes

I'm running: Mac OSX 10.6.8 ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0] and rubygems-1.8.9

But when I type in sudo gem install rails

I get the following errors:

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/bcrypt-ruby-3.0.1 for inspection. Results logged to /Library/Ruby/Gems/1.8/gems/bcrypt-ruby-3.0.1/ext/mri/gem_make.out

Thank for your help.

4

4 Answers

0
votes

You may want to use an open source pre-packaged Rails stack, like RubyStack (disclaimer, I am one of the developers). It is basically an all-in-one installer package, so there is nothing to compile / install (it can as easily be removed)

1
votes

I think the rails-dev* libraries are missing. So, you can just install the "rails-dev*" libraries on your system and try again to install the rails gem.

0
votes

Are you using the system ruby?

I suggest you:

  1. Install rvm
  2. Install Ruby 1.9.2 using rvm
  3. Install Ruby on Rails 3.1

Good luck

0
votes

You should check the log files that it pushes errors to, but it's more than likely that various gcc libraries are missing. [Re]Install XCode and try again.