ruby-on-rails-3 - Rails 3.2.3 sqlite gem 未安装

标签 ruby-on-rails-3 sqlite

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

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'

我看到同样的错误。

我应该做什么来修复它?

谢谢。

<小时/>

我更新了gems,但是这次出现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

最佳答案

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

关于ruby-on-rails-3 - Rails 3.2.3 sqlite gem 未安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10206127/

相关文章:

jquery - 用于 JS 和 HTML 渲染的 Rails 布局

java - Sqlite如何创建带有外键的表

android - SQLite 从多个表中选择数据

mysql - 在插入数据库之前清理字符串

ruby-on-rails - 设计邀请: Optionally Send Email

ruby-on-rails-3 - 使用 url 中的用户名登录后设计重定向

jquery - 使用变量指定部分要渲染的 rails 名称

Ruby 1.8.6,SQLite3 线程安全

c++ - 在 Windows 中使用 vscode 将 sqlite 与 C++ 链接时出错

ruby - rails 3.0.7 内存泄漏