sqlite3-ruby: Unable to install sqlite3 for Ruby2.0.0 on Windows 7
C:\Ruby200\DevKit>gem install sqlite3
Fetching: sqlite3-1.3.7.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.
C:/Ruby200/bin/ruby.exe extconf.rb
checking for 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-sqlite3-lib=${sqlite3-dir}/
--enable-local
--disable-local
Gem files will remain installed in C:/Ruby200/lib/ruby/gems/2.0.0/gems/sqlite3-1
.3.7 for inspection.
Results logged to C:/Ruby200/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.7/ext/sqlite3/
gem_make.out
and
C:\Ruby200\DevKit>gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 2.0.0
- RUBY VERSION: 2.0.0 (2013-02-24 patchlevel 0) [i386-mingw32]
- INSTALLATION DIRECTORY: C:/Ruby200/lib/ruby/gems/2.0.0
- RUBY EXECUTABLE: C:/Ruby200/bin/ruby.exe
- EXECUTABLE DIRECTORY: C:/Ruby200/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-mingw32
- GEM PATHS:
- C:/Ruby200/lib/ruby/gems/2.0.0
- C:/Users/yy/.gem/ruby/2.0.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
About this issue
- Original URL
- State: closed
- Created 14 years ago
- Reactions: 2
- Comments: 26 (11 by maintainers)
solved with
http://www.sqlite.org/download.html dl -> sqlite-amalgamation -> sqlite-dll-win32-x86
and extract same:
-include –sqlite3.h –sqlite3ext.h -lib –shell.c –sqlite3.c -sqlite3.def -sqlite3.dll
and install gem
gem install sqlite3 --platform=ruby – --with-sqlite3-include=path_to_include --with-sqlite3-lib=path_to_lib --with-sqlite3-dir=path_to_dll
it works for me
@yuumi3 looks like you don’t have the sqlite3 headers and libs that are required to install sqlite3 gem from source.
The pre-compiled binary for x86-mingw32 do not include binaries for Ruby 2.0, so I guess you installed with
--platform=ruby.You should obtain the headers and libraries for sqlite3 and use build arguments:
Where
C:/path/to/sqlite3is where the headers (include) and libs (lib) for sqlite3 are extracted.Hope that helps.
I’ve figured out how to install the sqlite3 gem in windows. You must compile sqlite3 manually to a “.a” library file using msys from the rubyinstall devkit.
Download the sqlite3 autoconf from sqlite’s site.
Compile the source code with .configure, make, and make install.
Go into the .libs directory, copy and paste the libsqlite3.a to your sqlite3 directory.
Then do gem install sqlite3 --platform=ruby – --with-sqlite3-dir=[sqlite3 directory].
I ended up extracting everything to my sqlite3 directory to make sure I had everything – the .exe shell, the .dll, the source, all of it.
Thanks luislavena,
I built sqlite3 library by mingw32.
and tried gem install, but failed again. Do you have any suggestions ?