2010-07-05 137 views
2

下面的錯誤出現:問題在sqlite3的安裝

C:\gem>gem install sqlite3-ruby --local 
Building native extensions. This could take a while... 
ERROR: Error installing sqlite3-ruby: 
     ERROR: Failed to build gem native extension. 

C:/Ruby/bin/ruby.exe extconf.rb 
checking for #include <sqlite3.h> 
... no 
sqlite3.h is missing. Install SQLite3 from http://www.sqlite.org/ first. 
*** 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 
     --srcdir=. 
     --curdir 
     --ruby=C:/Ruby/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 


Gem files will remain installed in C:/Ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1 
.3.0 for inspection. 
Results logged to C:/Ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.3.0/ext/sqlite3/ 
gem_make.out 

我複製所有在Ruby/bin文件夾所必需的文件,它仍然保持報告這個錯誤sqlite3.h丟失。

請確認我在哪裏放置sqlite3.h,當我在本地安裝gem時,您可以看到,我正在使用1.3.0版本的SQLite3進行安裝。 我已經嘗試過針對類似問題發佈的解決方案。我正在使用Windows XP。

在此先感謝。

+0

愚蠢的問題,你可能實際上已經回答了它,但我沒有注意到 - 但你真的安裝了sqlite3的可執行文件,因爲寶石建議? – Chowlett 2010-07-05 13:22:26

+0

我實際上已經複製了可執行文件sqlite3.exe,.dll文件以及一些其他必需的文件,這些文件都是我所做的,我沒有經過任何安裝過程。 – 2010-07-05 15:17:49

回答

3

我有這個問題。這是我找到的解決方案。這不是很漂亮,但它爲我工作。在我的情況下,我正在使用cygwin。也許有一種類似的方法可以不使用cygwin,但我不知道如何。

1)下載SQLite的源碼。我通過這個URL去了SQLite 3.6.23,有些是任意的: http://www.sqlite.org/src/info/4ae453ea7b 如果這樣不行,然後去發佈時間線http://www.sqlite.org/src/timeline?n=200&t=release&y=ci,選擇一個版本,然後下載它的ZIP文件。

2)將ZIP存檔解壓到某處。在cygwin中轉到該目錄。執行這些命令:

的./configure
使
使sqlite3.dll
使安裝

3)sqlite3.exe和sqlite3.dll從目錄複製其中make創造了他們進入你的道路上的某個地方。

4)一旦完成,gem install sqlite3-ruby終於工作。

我這個指南:http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/240902

+0

感謝它的工作,但我已經轉移到Ubuntu,我沒有遇到任何問題,但它會對其他人有所幫助。 – 2010-09-26 05:01:52

0

我把它按照以下建議工作:http://www.skorks.com/2009/08/installing-and-using-sqlite-with-ruby-on-windows/

基本上你可以從sqlite.org下載,DLL和shell文件,並確保您複製DLL在您已安裝的每個Ruby版本中,在他們的/bin目錄中。您可以將shell文件放在系統路徑的某個位置,我有一個文件夾c:\bin。然後你可以安裝pik gem install sqlite3

2

我知道這已經關閉了一段時間,但我有同樣的問題,並且這 幫助。安裝apt-cyg。首先通過標準的 cygwin安裝程序安裝subversion和wget。現在,使用apt-CYG安裝sqlite3的發展

wget rawgit.com/transcode-open/apt-cyg/master/apt-cyg 
install apt-cyg /bin 

:然後運行以下命令

apt-cyg install libsqlite3-devel 

最後

$ gem install sqlite3-ruby 
Building native extensions. This could take a while... 
Fetching: sqlite3-ruby-1.3.3.gem (100%) 

####################################################### 

Hello! The sqlite3-ruby gem has changed it's name to just sqlite3. Rather than 
installing `sqlite3-ruby`, you should install `sqlite3`. Please update your 
dependencies accordingly. 

Thanks from the Ruby sqlite3 team! 

<3 <3 <3 <3 

####################################################### 

Successfully installed sqlite3-1.3.6 
Successfully installed sqlite3-ruby-1.3.3 
2 gems installed 
Installing ri documentation for sqlite3-1.3.6... 
Installing ri documentation for sqlite3-ruby-1.3.3... 
Installing RDoc documentation for sqlite3-1.3.6... 
Installing RDoc documentation for sqlite3-ruby-1.3.3... 
-1

與sqlite3的(1.3取代。10-x64-mingw32)在Gemfile.lock中爲我工作。