# Can't install sqlite3-ruby gem in Windows

**URL:** <https://www.ruby-forum.com/t/cant-install-sqlite3-ruby-gem-in-windows/169513>\
**Category:** Ruby\
**Created:** [June 4, 2009, 6:32pm UTC](https://www.ruby-forum.com/t/cant-install-sqlite3-ruby-gem-in-windows/169513 "2009-06-04T18:32:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gnovah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/258eb7/32.png) [@gnovah](https://www.ruby-forum.com/u/gnovah)\
**Post date:** [June 4, 2009, 6:32pm UTC](https://www.ruby-forum.com/t/cant-install-sqlite3-ruby-gem-in-windows/169513/1 "2009-06-04T18:32:41Z")

</div>

I’m also having problems installing the sqlite3 gem on Windows. I  
downloaded sqlite-3\_6\_14\_2.zip and sqlitedll-3\_6\_14\_2.zip from  
[SQLite Download Page](http://www.sqlite.org/download.html) and extracted them to  
/WINDOWS/SYSTEM 32. But when I type gem install sqlite3-ruby in the  
command line I get:  
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 fdatasync() in rt.lib… no  
checking for sqlite3.h… no

nmake  
‘nmake’ is not recognized as an internal or external command,  
operable program or batch file.

Gem files will remain installed in  
c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1  
.2.4 for inspection.  
Results logged to  
c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4/ext/sqlite3\_  
api/gem\_make.out

C:\Documents and Settings\Nova\>gem install sqlite3-ruby  
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 fdatasync() in rt.lib… no  
checking for sqlite3.h… no

nmake  
‘nmake’ is not recognized as an internal or external command,  
operable program or batch file.

Gem files will remain installed in  
c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1  
.2.4 for inspection.  
Results logged to  
c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4/ext/sqlite3\_  
api/gem\_make.out

C:\Documents and Settings\Nova\>gem install sqlite3-ruby  
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 fdatasync() in rt.lib… no  
checking for sqlite3.h… no

nmake  
‘nmake’ is not recognized as an internal or external command,  
operable program or batch file.

Gem files will remain installed in  
c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1  
.2.4 for inspection.  
Results logged to  
c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4/ext/sqlite3\_  
api/gem\_make.out

Please help!! Thanks

---

<div class="post-metadata">

**Author:** ![gnovah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/258eb7/32.png) [@gnovah](https://www.ruby-forum.com/u/gnovah)\
**Post date:** [June 5, 2009, 2:15am UTC](https://www.ruby-forum.com/t/cant-install-sqlite3-ruby-gem-in-windows/169513/2 "2009-06-05T02:15:56Z")

</div>

On Jun 4, 1:32 pm, Nova P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> checking for sqlite3.h… no  
> api/gem\_make.out  
> nmake  
> C:\Documents and Settings\Nova\>gem install sqlite3-ruby  
> operable program or batch file.
> 
> Gem files will remain installed in  
> c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1  
> 2.4 for inspection.  
> Results logged to  
> c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4/ext/sqlite3\_  
> api/gem\_make.out
> 
> Please help!! Thanks

This has been covered before on this list, but just for the record:

Latest version of sqlite3-ruby lacks binaries for Windows. For you to  
build using version 1.2.4 of the gem also requires a compiler, which  
in your case must be Microsoft Visual C 6.0

Since is an obsolete compiler, highly unlikely you will find a  
downloadable version.

Please force the installation to prior version:

gem install sqlite3-ruby -v=1.2.3

HTH,

---

<div class="post-metadata">

**Author:** ![gnovah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/258eb7/32.png) [@gnovah](https://www.ruby-forum.com/u/gnovah)\
**Post date:** [June 5, 2009, 2:53pm UTC](https://www.ruby-forum.com/t/cant-install-sqlite3-ruby-gem-in-windows/169513/3 "2009-06-05T14:53:17Z")

</div>

Luis L. wrote:

> On Jun 4, 1:32ï¿½pm, Nova P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > Please help!! Thanks
> 
> This has been covered before on this list, but just for the record:
> 
> Latest version of sqlite3-ruby lacks binaries for Windows. For you to  
> build using version 1.2.4 of the gem also requires a compiler, which  
> in your case must be Microsoft Visual C 6.0

This is not quite true. I have several versions of Visual Studio on this  
system - VC 6, Visual Studio 2003, 2005 and 2008, and none of these can  
compile the gem, they all kick out various errors.

> Since is an obsolete compiler, highly unlikely you will find a  
> downloadable version.
> 
> Please force the installation to prior version:
> 
> gem install sqlite3-ruby -v=1.2.3

This is the only solution. Especially since the (ex)maintainer of gem is  
not supporting it anymore.

---

<div class="post-metadata">

**Author:** ![gnovah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/258eb7/32.png) [@gnovah](https://www.ruby-forum.com/u/gnovah)\
**Post date:** [June 6, 2009, 1:21am UTC](https://www.ruby-forum.com/t/cant-install-sqlite3-ruby-gem-in-windows/169513/4 "2009-06-06T01:21:35Z")

</div>

On 5 jun, 09:53, “John T.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> This is not quite true. I have several versions of Visual Studio on this  
> system - VC 6, Visual Studio 2003, 2005 and 2008, and none of these can  
> compile the gem, they all kick out various errors.

Because you also need to correct the extconf.rb in the source file and  
patch rbconfig of your ruby to support your compiler.

Plus you need headers and libs of sqlite3 to successfuly built it.

Been there, done that.

> > Since is an obsolete compiler, highly unlikely you will find a  
> > downloadable version.
> 
> > Please force the installation to prior version:
> 
> > gem install sqlite3-ruby -v=1.2.3
> 
> This is the only solution. Especially since the (ex)maintainer of gem is  
> not supporting it anymore.

That’s why I’ve been working on a 1.8 and 1.9 version of the gem,  
forked from original (ex)maintainer:

> **[GitHub - sparklemotion/sqlite3-ruby: Ruby bindings for the SQLite3 embedded...](https://github.com/sparklemotion/sqlite3-ruby/tree/master)**
>
> master

Still tests are failing on 1.9, one of the reasons I’m not sending a  
pull request to James Buck to merge and integrate those.

Also, working on fat binaries for 1.9 and 1.8 to workaround issues  
when installing the exact same gem binary on differnt ruby versions.

Busy busy busy 😛

Regards,

---

<div class="post-metadata">

**Author:** ![gnovah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/258eb7/32.png) [@gnovah](https://www.ruby-forum.com/u/gnovah)\
**Post date:** [June 5, 2009, 7:47pm UTC](https://www.ruby-forum.com/t/cant-install-sqlite3-ruby-gem-in-windows/169513/5 "2009-06-05T19:47:26Z")

</div>

Thanks so much! That worked

---

<div class="post-metadata">

**Author:** ![gnovah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/258eb7/32.png) [@gnovah](https://www.ruby-forum.com/u/gnovah)\
**Post date:** [June 6, 2009, 8:41pm UTC](https://www.ruby-forum.com/t/cant-install-sqlite3-ruby-gem-in-windows/169513/6 "2009-06-06T20:41:45Z")

</div>

> This is not quite true. I have several versions of Visual Studio on this  
> system - VC 6, Visual Studio 2003, 2005 and 2008, and none of these can  
> compile the gem, they all kick out various errors.

Luis’ fork does build with mingw.

> **[how to install sqlite3 from source on ruby mingw (1.8 or 1.9)](http://programming-gone-awry.blogspot.com/2009/05/how-to-install-sqlite3-binaries-on-ruby.html)**
>
> here they are, inspired by a question from Charles Roper 1) install wget or curl in path 2) install unzip.exe (http://gnuwin32.sourceforge.n...

might help.  
Cheers!  
-=r
