2013-06-04 20 views
0

喜歡標題說... 我一直在教自己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. 

回答

0
sudo apt-get install libsqlite3-dev 

,如果你使用的是Debian發行版的基地使用。

sudo yum install sqlite-devel 

如果您使用的是基於redhat的發行版。

之後做gem install sqlite3。這應該工作

我從來沒有使用Mac,但使用rvm來安裝rails。在命令行中輸入rvm requirements,然後安裝列出的所有軟件包。

0

我有類似的問題。如果您不介意重置您的寶石,請按照下面的選項進行操作。

轉到下面的鏈接並下載適用於您的操作系統的安裝程序。

它安裝一切完美和快速所有在1個工作包。

http://railsinstaller.org/

+0

請記得接受/ upvote有用的解決方案 – JaTo

相關問題