sqlite Bundle安装错误

时间:2011-08-15 03:51:44

标签: ruby-on-rails ruby bundle

据我所知,我没有改变任何事情。这刚刚开始发生,我无法理解为什么。

每当我尝试运行“捆绑安装”时,无论是在新项目还是新项目中,我都会收到以下错误...

Installing sqlite3 (1.3.4) with native extensions /Users/Jon/.rvm/rubies/ruby-1.9.2-    p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:533:in `rescue in block in build_extensions': ERROR: Failed to build gem native     extension. (Gem::Installer::ExtensionBuildError)

        /Users/Jon/.rvm/rubies/ruby-1.9.2-p180/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/Jon/.rvm/rubies/ruby-1.9.2-p180/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/Jon/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed to generate an executable file.     (RuntimeError)
You have to install development tools first.
from /Users/Jon/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:452:in `try_cpp'
from /Users/Jon/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:853:in `block in find_header'
from /Users/Jon/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for'
from /Users/Jon/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postpone'
from /Users/Jon/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/Jon/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone'
from /Users/Jon/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/Jon/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:276:in `postpone'
from /Users/Jon/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for'
from /Users/Jon/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:852:in `find_header'
from extconf.rb:34:in `<main>'


Gem files will remain installed in /Users/Jon/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/sqlite3-1.3.4 for inspection.
Results logged to /Users/Jon/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/sqlite3-1.3.4/ext/sqlite3/gem_make.out
from /Users/Jon/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:511:in `block in build_extensions'
from /Users/Jon/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:486:in `each'
from /Users/Jon/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:486:in `build_extensions'
from /Users/Jon/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:159:in `install'
from /Users/Jon/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.0.15/lib/bundler/source.rb:101:in `block in install'
from /Users/Jon/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb:78:in  `preserve_paths'
from /Users/Jon/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.0.15/lib/bundler/source.rb:91:in `install'
from /Users/Jon/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.0.15/lib/bundler/installer.rb:58:in `block (2 levels) in run'
from /Users/Jon/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb:93:in `with_build_args'
from /Users/Jon/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.0.15/lib/bundler/installer.rb:57:in `block in run'
from /Users/Jon/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `block in each'
from /Users/Jon/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `each'
from /Users/Jon/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `each'
from /Users/Jon/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.0.15/lib/bundler/installer.rb:49:in `run'
from /Users/Jon/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.0.15/lib/bundler/installer.rb:8:in `install'
from /Users/Jon/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.0.15/lib/bundler/cli.rb:222:in `install'
from /Users/Jon/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.0.15/lib/bundler/vendor/thor/task.rb:22:in `run'
from /Users/Jon/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.0.15/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /Users/Jon/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.0.15/lib/bundler/vendor/thor.rb:246:in `dispatch'
from /Users/Jon/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.0.15/lib/bundler/vendor/thor/base.rb:389:in `start'
from /Users/Jon/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.0.15/bin/bundle:13:in `<top (required)>'
from /Users/Jon/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/bin/bundle:19:in `load'
from /Users/Jon/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/bin/bundle:19:in `<main>'

我试过谷歌搜索但没有提出任何问题。有什么想法吗?

非常感谢任何帮助!

2 个答案:

答案 0 :(得分:0)

添加

gem'sqlite3','1.3.3'

gem'sqlite3-ruby','1.3.3'

作为解决方法。不清楚解决方案的用途 现在,但Rails 3.1.0.rc5对我有用。

答案 1 :(得分:0)

我对失败的宝石的经验表明,它通常缺少构建所需的某种开发库。错误消息当然不表示我认为我对捆绑安装的一个主要抱怨:/

那说,安装libsqlite3-dev为我修复了这个错误。 YMMV。