1

我将我的 MAC OSX 版本更改为 Lion。之后,我尝试创建一个新的 Rails 3.2.3 应用程序。但是,运行捆绑安装时出现错误,

使用原生扩展安装 sqlite3 (1.3.6) 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 可能缺少必要的库和/或头文件。检查 mkmf.log 文件以获取更多详细信息。您可能需要配置选项。

提供的配置选项: --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' 来自 /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 checks_for' 来自 /Users/ender/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf。 RB:284:在 block (2 levels) in postpone' from /Users/ender/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:254:in 从 /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' 来自 /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 checks_for' 来自 /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 文件将继续安装在 /Users/ender/.rvm/gems/ruby-1.9.3-p0/gems/sqlite3-1.3.6 中以供检查。结果记录到 /Users/ender/.rvm/gems/ruby-1.9.3-p0/gems/sqlite3-1.3.6/ext/sqlite3/gem_make.out 安装 sqlite3 (1.3.6) 和 Bundler 时出错无法继续。gem install sqlite3 -v '1.3.6'在捆绑之前确保成功。

当我尝试

宝石安装 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
4

1 回答 1

2

尝试重新安装/升级您的 Xcode。然后尝试再次安装 sqlite

于 2012-04-18T10:47:20.587 回答