2012-04-18 147 views
1

我將我的MAC OSX版本更改爲Lion。之後,我嘗試創建一個新的Rails 3.2.3應用程序。但是有喜歡同時運行的捆綁安裝,Rails 3.2.3 sqlite gem未安裝

Installing sqlite3 (1.3.6) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/Users/ender/.rvm/rubies/ruby-1.9.3-p0/bin/ruby extconf.rb checking for sqlite3.h... *** extconf.rb failed *** Could not create 

Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/Users/ender/.rvm/rubies/ruby-1.9.3-p0/bin/ruby --with-sqlite3-dir --without-sqlite3-dir --with-sqlite3-include --without-sqlite3-include=${sqlite3-dir}/include --with-sqlite3-lib --without-sqlite3-lib=${sqlite3-dir}/lib --enable-local --disable-local /Users/ender/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:381:in try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from /Users/ender/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:506:in try_cpp' from /Users/ender/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:970:in block in find_header' from /Users/ender/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:790:in block in checking_for' from /Users/ender/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:284:in block (2 levels) in postpone' from /Users/ender/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:254:in open' from /Users/ender/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:284:in block in postpone' from /Users/ender/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:254:in open' from /Users/ender/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:280:in postpone' from /Users/ender/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:789:in checking_for' from /Users/ender/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:969:in find_header' from extconf.rb:34:in '

Gem files will remain installed in /Users/ender/.rvm/gems/ruby-1.9.3-p0/gems/sqlite3-1.3.6 for inspection. Results logged to /Users/ender/.rvm/gems/ruby-1.9.3-p0/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.

一個錯誤,當我嘗試

gem install sqlite3 -v '1.3.6'

我看到了同樣的錯誤。

我應該怎麼做才能解決它?

謝謝。


我更新了寶石,但就在這個時候發生錯誤的JSON

Installing json (1.6.6) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 

     /Users/ender/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb 
creating Makefile 

make 
sh: make: command not found 


Gem files will remain installed in /Users/ender/.rvm/gems/ruby-1.9.2-p290/gems/json-1.6.6 for inspection. 
Results logged to /Users/ender/.rvm/gems/ruby-1.9.2-p290/gems/json-1.6.6/ext/json/ext/generator/gem_make.out 
An error occured while installing json (1.6.6), and Bundler cannot continue. 
Make sure that `gem install json -v '1.6.6'` succeeds before bundling. 
enders-MacBook-Pro:kodcu ender$ gem install json -v '1.6.6' 
Building native extensions. This could take a while... 
ERROR: Error installing json: 
    ERROR: Failed to build gem native extension. 

     /Users/ender/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb 
creating Makefile 

make 
sh: make: command not found 


Gem files will remain installed in /Users/ender/.rvm/gems/ruby-1.9.2-p290/gems/json-1.6.6 for inspection. 
Results logged to /Users/ender/.rvm/gems/ruby-1.9.2-p290/gems/json-1.6.6/ext/json/ext/generator/gem_make.out 

回答

2

嘗試重新安裝/升級您的Xcode。然後再次嘗試安裝sqlite

+0

經過這樣的重大操作系統升級之後,完全擦除並重新安裝所有的紅寶石和寶石是一個好主意。 – Thilo 2012-04-18 10:51:29

+0

是的。我現在正在安裝Xcode 4.3.2。但我不知道它將如何升級,因爲我已經得到了Xcode 3.2 ... – ndrx42 2012-04-18 11:21:05

+0

@endeR:如果它解決了問題,請更新。謝謝.. – Pravin 2012-04-19 06:23:12