喜歡標題說... 我一直在教自己RoR過去幾周,我對某事感到困惑。 我經歷了教程here沒問題。沒有問題安裝寶石或任何東西。現在我決定從this book瞭解更多。所以我用rvm安裝了1.9.3,發現自己無法安裝SQLite3。無法在Ruby 1.9.3上安裝SQLite3 gem,而Ruby 2.0.0則沒有問題。有什麼不同?
這是什麼問題?它在新版本上安裝得很好,一旦我切換回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 [email protected]/gems/sqlite3 1.3.5 for inspection.
Results logged to /Users/ME/.rvm/gems/[email protected]/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.
請記得接受/ upvote有用的解決方案 – JaTo