开发者

Problem in SQLite3 installation

The following error comes up:

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}/i开发者_运维百科nclude
        --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

I have copied all the necessary files required in the Ruby/Bin folder, still it keeps reporting this error that sqlite3.h is missing.

Please do tell where do I have to place sqlite3.h, when I am installing the gem locally as you can see and I am currently using 1.3.0 version of SQLite3 for its installation. I have tried with the solutions that were posted for similar problems. And I am using Windows XP.

Thanks in advance.


I had this problem. This is the solution I found. It's not very pretty, but it worked for me. In my case, I was using cygwin. There's probably a similar way to do it without using cygwin, but I don't know how.

1) Download the source of SQLite. I went for SQLite 3.6.23, somewhat arbitrarily, via this URL: http://www.sqlite.org/src/info/4ae453ea7b If that doesn't work, then go to the release timeline at http://www.sqlite.org/src/timeline?n=200&t=release&y=ci , choose a release, and download the ZIP file of it.

2) Unpack the ZIP archive somewhere. Go to that directory in cygwin. Execute these commands:

./configure
make
make sqlite3.dll
make install

3) Copy the sqlite3.exe and sqlite3.dll from the directory where make created them into somewhere on your path.

4) Once that's done, gem install sqlite3-ruby finally worked.

I was following this guide: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/240902


I know this has been closed for a while but I was having the same issue and this helped. Install apt-cyg. First install subversion and wget through the standard cygwin setup program. Then run the following commands:

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

Now using apt-cyg install the sqlite3 development:

apt-cyg install libsqlite3-devel

and finally

$ 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...


I got it working by following these suggestions: http://www.skorks.com/2009/08/installing-and-using-sqlite-with-ruby-on-windows/

Basically you can download from sqlite.org, the DLL and shell file and make sure you copy the DLL in each of the ruby versions you have installed, in their /bin directory. You can place the shell file somewhere in your system path, I have a folder c:\bin. Then you can install pik gem install sqlite3


replace with sqlite3 (1.3.10-x64-mingw32) in Gemfile.lock worked for me.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜