我将我的MAC OSX版本更改为Lion。之后,我尝试创建一个新的Rails 3.2.3应用程序。但是,运行bundle install时会出现错误,
使用本机扩展安装sqlite3(1.3.6) Gem :: Installer :: ExtensionBuildError:错误:无法构建gem native 扩展
/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 = /用户/安德/ .rvm /红宝石/红宝石1.9.3-P0 /斌/红宝石 --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 - 禁用本地 /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:inblock in find_header' from /Users/ender/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:790:in
阻止来自check_for' /Users/ender/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:284:inblock (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:inblock 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:280:inpostpone' from /Users/ender/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:789:in
来自check_for' /Users/ender/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:969:infind_header' from extconf.rb:34:in
“Gem文件将保持安装状态 /Users/ender/.rvm/gems/ruby-1.9.3-p0/gems/sqlite3-1.3.6 for 检查。记录结果 /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'
成功 在捆绑之前。
当我尝试
时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
答案 0 :(得分:2)
尝试重新安装/升级您的Xcode。然后再次尝试安装sqlite