2011-04-27 234 views
1

當我去安裝使用「sudo的包安裝」,安裝所有的人......它拋出一個錯誤上的sqlite3:爲什麼我無法安裝sqlite?

Installing sqlite3 (1.3.3) with native extensions /Library/Ruby/Site/1.8/rubygems/installer.rb:533:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) 

      /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.3 for inspection. 
    Results logged to /Library/Ruby/Gems/1.8/gems/sqlite3-1.3.3/ext/sqlite3/gem_make.out 
     from /Library/Ruby/Site/1.8/rubygems/installer.rb:486:in `each' 
     from /Library/Ruby/Site/1.8/rubygems/installer.rb:486:in `build_extensions' 
     from /Library/Ruby/Site/1.8/rubygems/installer.rb:159:in `install' 
     from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/source.rb:96:in `install' 
     from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/installer.rb:55:in `run' 
     from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/spec_set.rb:12:in `each' 
     from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/spec_set.rb:12:in `each' 
     from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/installer.rb:44:in `run' 
     from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/installer.rb:8:in `install' 
     from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/cli.rb:225:in `install' 
     from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/vendor/thor/task.rb:22:in `send' 
     from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/vendor/thor/task.rb:22:in `run' 
     from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task' 
     from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/vendor/thor.rb:246:in `dispatch' 
     from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/vendor/thor/base.rb:389:in `start' 
     from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/bin/bundle:13 
     from /usr/bin/bundle:19:in `load' 
     from /usr/bin/bundle:19 

然後我想,也許我有它已經安裝了,因爲我已經用它之前......但是當我做「耙分貝:創建」它給了我這樣的:

找不到寶石「sqlite3的(> = 0)」中的任何在你的Gemfile中列出的寶石的來源。

我在做什麼錯?

+0

什麼系統?從你的路徑看,它看起來像MacOS X.你是否安裝了開發者工具? – ghoppe 2011-04-27 04:20:03

回答

3

確保您已安裝XCode。必需的頭文件應該由此安裝。

另外,無關的建議,停止使用sudo。看看installing RVM。它會讓你的生活更輕鬆。

相關問題:Snow Leopard & Ruby on Rails - SQLite3 issue

+0

另外值得一提的是[MacPorts](http://macports.org/)和[Homebrew](http://mxcl.github.com/homebrew/)來管理依賴庫。 – tadman 2011-04-27 05:10:48

+0

xcode解決了這個問題......謝謝! – 2011-04-28 16:56:46

0

您可能缺少sqlite3.dll文件。轉到ruby文件夾中的bin文件夾並查找sql​​ite3.dll文件。如果在那裏找不到它,請將其下載爲http://www.sqlite.org/download.html。然後將dll文件放在bin(ruby的bin)文件夾中,再次運行bundle install,看看是否可行。

+1

這是基於錯誤消息的OS X安裝。 – tadman 2011-04-27 05:09:22

相關問題