Forum: Ruby Can't install sqlite3-ruby gem in Windows

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Nova P. (Guest)
on 2009-06-04 20:32
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
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
Luis L. (Guest)
on 2009-06-05 04:15
(Received via mailing list)
On Jun 4, 1:32 pm, Nova P. <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,
John T. (Guest)
on 2009-06-05 16:53
Luis L. wrote:
> On Jun 4, 1:32�pm, Nova P. <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.
Nova P. (Guest)
on 2009-06-05 21:47
Thanks so much! That worked
Luis L. (Guest)
on 2009-06-06 03:21
(Received via mailing list)
On 5 jun, 09:53, "John T." <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:

http://github.com/luislavena/sqlite3-ruby/tree/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 :P

Regards,
Roger P. (Guest)
on 2009-06-06 22:41
> 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.
http://programming-gone-awry.blogspot.com/2009/05/...
might help.
Cheers!
-=r
This topic is locked and can not be replied to.