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 ty开发者_开发技巧pe 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.
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.
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)
Are you using the system ruby?
I suggest you:
- Install rvm
- Install Ruby 1.9.2 using rvm
- Install Ruby on Rails 3.1
Good luck
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.
精彩评论