就像标题所说的那样……过去几周我一直在自学 RoR,但我对某些事情感到困惑。我在这里完成了教程没有问题。安装宝石或任何东西都没有问题。现在我决定从这本书中学到更多。于是我用rvm安装了1.9.3,发现自己无法安装SQLite3。
有什么问题?它在较新的版本上安装得很好,一旦我切换回 Ruby 2.0.0,安装那个版本的 SQLite 就没有问题了。如果有帮助,我在 Mac OS 10.6.8 上。
这是我失败的终端输出:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/ME/.rvm/rubies/ruby-1.9.3-p429/bin/ruby extconf.rb
checking for sqlite3.h... yes
checking for sqlite3_libversion_number() in -lsqlite3... no
sqlite3 is missing. Try 'port install sqlite3 +universal'
or 'yum install sqlite-devel' and check your shared library search path (the
location where your sqlite3 shared library is located).
*** 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
--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/ME/.rvm/rubies/ruby-1.9.3-p429/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
--with-sqlite3lib
--without-sqlite3lib
Gem files will remain installed in /Users/ME/.rvm/gems/ruby-1.9.3 p429@rails3tutorial2ndEd/gems/sqlite3 1.3.5 for inspection.
Results logged to /Users/ME/.rvm/gems/ruby-1.9.3-p429@rails3tutorial2ndEd/gems/sqlite3-1.3.5/ext/sqlite3/gem_make.out
An error occurred while installing sqlite3 (1.3.5), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.5'` succeeds before bundling.