2012-08-04 58 views
0
Master:demo shaunstanislaus$ rails server Could not find gem 'sqlite3 
(>= 0) ruby' in the gems available on this machine. Run `bundle 
install` to install missing gems. Master:demo shaunstanislaus$ sudo 
bundle install Password: Fetching gem metadata from 
https://rubygems.org/......... Using rake (0.9.2.2) Using i18n 
(0.6.0) Using multi_json (1.3.6) Using activesupport (3.2.6) Using 
builder (3.0.0) Using activemodel (3.2.6) Using erubis (2.7.0) 
Using journey (1.0.4) Using rack (1.4.1) Using rack-cache (1.2) 
Using rack-test (0.6.1) Using hike (1.2.1) Using tilt (1.3.3) Using 
sprockets (2.1.3) Using actionpack (3.2.6) Using mime-types (1.19) 
Using polyglot (0.3.3) Using treetop (1.4.10) Using mail (2.4.4) 
Using actionmailer (3.2.6) Using arel (3.0.2) Using tzinfo (0.3.33) 
Using activerecord (3.2.6) Using activeresource (3.2.6) Using 
bundler (1.1.5) Using coffee-script-source (1.3.3) Using execjs 
(1.4.0) Using coffee-script (2.2.0) Using rack-ssl (1.3.2) Using 
json (1.7.4) Using rdoc (3.12) Using thor (0.15.4) Using railties 
(3.2.6) Using coffee-rails (3.2.2) Using jquery-rails (2.0.2) Using 
rails (3.2.6) Using sass (3.1.20) Using sass-rails (3.2.5) 
Installing sqlite3 (1.3.6) with native extensions 
Gem::Installer::ExtensionBuildError: 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/sqlite3-1.3.6 for inspection. Results 
logged to 
/Library/Ruby/Gems/1.8/gems/sqlite3-1.3.6/ext/sqlite3/gem_make.out An 
error occured while installing sqlite3 (1.3.6), and Bundler cannot 
continue. Make sure that `gem install sqlite3 -v '1.3.6'` succeeds 
before bundling. Master:demo shaunstanislaus$ 

如何解决这个问题?OS X Mountain Lion上sqlite3 + Rails问题的问题

+0

看起来与http://stackoverflow.com/questions/421225/why-cant-i-install-the-sqlite-gem – 2012-08-04 18:53:30

回答

2

我会确保你安装了OSX开发工具(带有gcc等的XCode)。如果你确定你有这些工具,那么下一步就是跟随之前链接到的问题(安装ruby-devel和sqlite3-devel)。