2010-07-05 140 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中为我工作。