简体   繁体   中英

Problems with sqlite3 + Rails problems on OS X Mountain Lion

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$

How do I fix this?

I would make sure you have OSX developer tools installed (XCode with gcc and so on). If you are sure you have the tools then the next step would be to follow the question that was linked to earlier (installing ruby-devel and sqlite3-devel).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM