# SQLite / Ruby on Windows?

**URL:** <https://rubytalk.org/t/sqlite-ruby-on-windows/21232>\
**Category:** ruby-talk\
**Created:** [30 September 2005 13:49 UTC](https://rubytalk.org/t/sqlite-ruby-on-windows/21232 "2005-09-30T13:49:33Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Vallner](https://avatars.discourse-cdn.com/v4/letter/d/eb9ed0/32.png) [@David\_Vallner](https://rubytalk.org/u/David_Vallner)\
**Post date:** [30 September 2005 13:49 UTC](https://rubytalk.org/t/sqlite-ruby-on-windows/21232/1 "2005-09-30T13:49:33Z")

</div>

Does anyone have an install-by-copy version of the SQLite Ruby binding at hand?  
I'm in sore need of an embeddable SQL database and I admit to being completely  
uncapable of compiling Ruby extensions on my Windows box.

David Vallner

---

<div class="post-metadata">

**Author:** ![Austin\_Ziegler5](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/austin_ziegler5/32/1985_2.png) [@Austin\_Ziegler5](https://rubytalk.org/u/Austin_Ziegler5)\
**Post date:** [30 September 2005 14:14 UTC](https://rubytalk.org/t/sqlite-ruby-on-windows/21232/2 "2005-09-30T14:14:14Z")

</div>

Try installing it with RubyGems.

-austin

> **···**
>
> On 9/30/05, david@vallner.net \<david@vallner.net\> wrote:
> 
> > Does anyone have an install-by-copy version of the SQLite Ruby binding at hand?  
> > I'm in sore need of an embeddable SQL database and I admit to being completely  
> > uncapable of compiling Ruby extensions on my Windows box.
> 
> --  
> Austin Ziegler \* halostatue@gmail.com  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\* Alternate: austin@halostatue.ca

---

<div class="post-metadata">

**Author:** ![Jeff\_Wood](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@Jeff\_Wood](https://rubytalk.org/u/Jeff_Wood)\
**Post date:** [30 September 2005 16:20 UTC](https://rubytalk.org/t/sqlite-ruby-on-windows/21232/3 "2005-09-30T16:20:38Z")

</div>

There are three phases:

#1 - Collect underpants  
#2 - ??  
#3 - Profit!

just kidding ...

Here are the steps to get it working.

#1 Download [http://www.sqlite.org/sqlite-3\_2\_7.zip](http://www.sqlite.org/sqlite-3_2_7.zip)  
#2 Download [http://www.sqlite.org/sqlitedll-3\_2\_7.zip](http://www.sqlite.org/sqlitedll-3_2_7.zip)

Unzip and install the resulting files into your C:\Windows\System32  
directory

#3 Use "gem" to install the sqlite3 package:

"gem install sqlite3"

… when prompted by the installer, type 2 and press enter. This will install  
sqlite3-ruby 1.1.0 (mswin32)

It will run for a bit and should end successfully

You can now use SQLite3

From irb use the following test script:

--SCRIPT--  
require 'sqlite3'

db = SQLite3::Database.new( "test.db" )  
db.execute( "create table test ( foo int, bar text, baz int );" )  
db.execute( "insert into test ( foo, bar, baz ) values ( 1, 'test', 3 );" )  
db.execute( "select \* from test" ) { |row| puts row.join( ',' ) }  
db.execute2( "select \* from test" ) { |row| puts row.join( ',' ) }  
--SCRIPT--

j.

> **···**
>
> On 9/30/05, Austin Ziegler \<halostatue@gmail.com\> wrote:
> 
> > On 9/30/05, david@vallner.net \<david@vallner.net\> wrote:  
> > \> Does anyone have an install-by-copy version of the SQLite Ruby binding  
> > at hand?  
> > \> I'm in sore need of an embeddable SQL database and I admit to being  
> > completely  
> > \> uncapable of compiling Ruby extensions on my Windows box.
> > 
> > Try installing it with RubyGems.
> > 
> > -austin  
> > --  
> > Austin Ziegler \* halostatue@gmail.com  
> > \* Alternate: austin@halostatue.ca
> 
> --  
> "[http://ruby-lang.org](http://ruby-lang.org) -- do you ruby?"
> 
> Jeff Wood

---

<div class="post-metadata">

**Author:** ![basi](https://avatars.discourse-cdn.com/v4/letter/b/a3d4f5/32.png) [@basi](https://rubytalk.org/u/basi)\
**Post date:** [1 October 2005 03:46 UTC](https://rubytalk.org/t/sqlite-ruby-on-windows/21232/4 "2005-10-01T03:46:45Z")

</div>

Hello,  
Been wanting to try Ruby and Sqlite3...

But step #3 does not work. Gem install says:

Local gem file not found: sqlite3\*.gem.

Then, in the attempt to do a remote install, again the complaint is  
that sqlite3 could not be found in the repository?

Might I have missed a step here?

Thanks,  
Basi

Jeff Wood wrote:

> **···**
>
> > There are three phases:
> > 
> > #1 - Collect underpants  
> > #2 - ??  
> > #3 - Profit!
> > 
> > just kidding ...
> > 
> > Here are the steps to get it working.
> > 
> > #1 Download [http://www.sqlite.org/sqlite-3\_2\_7.zip](http://www.sqlite.org/sqlite-3_2_7.zip)  
> > #2 Download [http://www.sqlite.org/sqlitedll-3\_2\_7.zip](http://www.sqlite.org/sqlitedll-3_2_7.zip)
> > 
> > Unzip and install the resulting files into your C:\Windows\System32  
> > directory
> > 
> > #3 Use "gem" to install the sqlite3 package:
> > 
> > "gem install sqlite3"
> > 
> > ... when prompted by the installer, type 2 and press enter. This will install  
> > sqlite3-ruby 1.1.0 (mswin32)
> > 
> > It will run for a bit and should end successfully
> > 
> > You can now use SQLite3
> > 
> > From irb use the following test script:
> > 
> > --SCRIPT--  
> > require 'sqlite3'
> > 
> > db = SQLite3::Database.new( "test.db" )  
> > db.execute( "create table test ( foo int, bar text, baz int );" )  
> > db.execute( "insert into test ( foo, bar, baz ) values ( 1, 'test', 3 );" )  
> > db.execute( "select \* from test" ) { |row| puts row.join( ',' ) }  
> > db.execute2( "select \* from test" ) { |row| puts row.join( ',' ) }  
> > --SCRIPT--
> > 
> > j.
> > 
> > On 9/30/05, Austin Ziegler \<halostatue@gmail.com\> wrote:  
> > \>  
> > \> On 9/30/05, david@vallner.net \<david@vallner.net\> wrote:  
> > \> \> Does anyone have an install-by-copy version of the SQLite Ruby binding  
> > \> at hand?  
> > \> \> I'm in sore need of an embeddable SQL database and I admit to being  
> > \> completely  
> > \> \> uncapable of compiling Ruby extensions on my Windows box.  
> > \>  
> > \> Try installing it with RubyGems.  
> > \>  
> > \> -austin  
> > \> --  
> > \> Austin Ziegler \* halostatue@gmail.com  
> > \> \* Alternate: austin@halostatue.ca  
> > \>  
> > \>
> > 
> > --  
> > "[http://ruby-lang.org](http://ruby-lang.org) -- do you ruby?"
> > 
> > Jeff Wood

---

<div class="post-metadata">

**Author:** ![David\_Vallner](https://avatars.discourse-cdn.com/v4/letter/d/eb9ed0/32.png) [@David\_Vallner](https://rubytalk.org/u/David_Vallner)\
**Post date:** [5 October 2005 17:54 UTC](https://rubytalk.org/t/sqlite-ruby-on-windows/21232/5 "2005-10-05T17:54:37Z")

</div>

\*blush\* Silly me didn't notice the mswin binary distro of the extension.

Citát Jeff Wood \<jeff.darklight@gmail.com\>:

> There are three phases:
> 
> #1 - Collect underpants  
> #2 - ??  
> #3 - Profit!

I -am- intrugued now 😜

> just kidding ...

Awww...

> Unzip and install the resulting files into your C:\Windows\System32  
> directory

I sincerely hope you're not serious, there's enough banter in that directory  
already. I'll have to womble about the ruby installation dir to find out where  
does windows look for DLLs, or just hack PATH to include a suitable location  
before running the script.

Cheers anyway, that should make the DBMS 301 assignment insanely easier, what  
with being able to deploy without installing anything.

---

<div class="post-metadata">

**Author:** ![Christopher\_Aldridge](https://avatars.discourse-cdn.com/v4/letter/c/34f0e0/32.png) [@Christopher\_Aldridge](https://rubytalk.org/u/Christopher_Aldridge)\
**Post date:** [1 October 2005 03:53 UTC](https://rubytalk.org/t/sqlite-ruby-on-windows/21232/6 "2005-10-01T03:53:04Z")

</div>

try, gem install sqlite3-ruby

> **···**
>
> On 9/30/05, basi \<basi\_lio@hotmail.com\> wrote:
> 
> > Hello,  
> > Been wanting to try Ruby and Sqlite3...
> > 
> > But step #3 does not work. Gem install says:
> > 
> > Local gem file not found: sqlite3\*.gem.
> > 
> > Then, in the attempt to do a remote install, again the complaint is  
> > that sqlite3 could not be found in the repository?
> > 
> > Might I have missed a step here?
> > 
> > Thanks,  
> > Basi
> > 
> > Jeff Wood wrote:  
> > \> There are three phases:  
> > \>  
> > \> #1 - Collect underpants  
> > \> #2 - ??  
> > \> #3 - Profit!  
> > \>  
> > \> just kidding ...  
> > \>  
> > \> Here are the steps to get it working.  
> > \>  
> > \> #1 Download [http://www.sqlite.org/sqlite-3\_2\_7.zip](http://www.sqlite.org/sqlite-3_2_7.zip)  
> > \> #2 Download [http://www.sqlite.org/sqlitedll-3\_2\_7.zip](http://www.sqlite.org/sqlitedll-3_2_7.zip)  
> > \>  
> > \> Unzip and install the resulting files into your C:\Windows\System32  
> > \> directory  
> > \>  
> > \> #3 Use "gem" to install the sqlite3 package:  
> > \>  
> > \> "gem install sqlite3"  
> > \>  
> > \> ... when prompted by the installer, type 2 and press enter. This will install  
> > \> sqlite3-ruby 1.1.0 (mswin32)  
> > \>  
> > \> It will run for a bit and should end successfully  
> > \>  
> > \> You can now use SQLite3  
> > \>  
> > \> From irb use the following test script:  
> > \>  
> > \>  
> > \> --SCRIPT--  
> > \> require 'sqlite3'  
> > \>  
> > \> db = SQLite3::Database.new( "test.db" )  
> > \> db.execute( "create table test ( foo int, bar text, baz int );" )  
> > \> db.execute( "insert into test ( foo, bar, baz ) values ( 1, 'test', 3 );" )  
> > \> db.execute( "select \* from test" ) { |row| puts row.join( ',' ) }  
> > \> db.execute2( "select \* from test" ) { |row| puts row.join( ',' ) }  
> > \> --SCRIPT--  
> > \>  
> > \>  
> > \> j.  
> > \>  
> > \> On 9/30/05, Austin Ziegler \<halostatue@gmail.com\> wrote:  
> > \> \>  
> > \> \> On 9/30/05, david@vallner.net \<david@vallner.net\> wrote:  
> > \> \> \> Does anyone have an install-by-copy version of the SQLite Ruby binding  
> > \> \> at hand?  
> > \> \> \> I'm in sore need of an embeddable SQL database and I admit to being  
> > \> \> completely  
> > \> \> \> uncapable of compiling Ruby extensions on my Windows box.  
> > \> \>  
> > \> \> Try installing it with RubyGems.  
> > \> \>  
> > \> \> -austin  
> > \> \> --  
> > \> \> Austin Ziegler \* halostatue@gmail.com  
> > \> \> \* Alternate: austin@halostatue.ca  
> > \> \>  
> > \> \>  
> > \>  
> > \>  
> > \> --  
> > \> "[http://ruby-lang.org](http://ruby-lang.org) -- do you ruby?"  
> > \>  
> > \> Jeff Wood

---

<div class="post-metadata">

**Author:** ![James\_Britt4](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@James\_Britt4](https://rubytalk.org/u/James_Britt4)\
**Post date:** [1 October 2005 06:04 UTC](https://rubytalk.org/t/sqlite-ruby-on-windows/21232/7 "2005-10-01T06:04:34Z")

</div>

basi wrote:

> Hello,  
> Been wanting to try Ruby and Sqlite3...
> 
> But step #3 does not work. Gem install says:
> 
> Local gem file not found: sqlite3\*.gem.
> 
> Then, in the attempt to do a remote install, again the complaint is  
> that sqlite3 could not be found in the repository?
> 
> Might I have missed a step here?

Here's what works for me:

d:\development\>gem install sqlite3

d:\development\>"c:\ruby\bin\ruby.exe" "c:\ruby\bin\gem" install sqlite3  
Attempting local installation of 'sqlite3'  
Local gem file not found: sqlite3\*.gem  
Attempting remote installation of 'sqlite3'  
Select which gem to install for your platform (i386-mswin32)  
&nbsp;&nbsp;1. sqlite3-ruby 1.1.0 (ruby)  
&nbsp;&nbsp;2. sqlite3-ruby 1.1.0 (mswin32)  
&nbsp;&nbsp;3. sqlite3-ruby 1.0.1 (ruby)  
&nbsp;&nbsp;4. sqlite3-ruby 1.0.1 (mswin32)  
&nbsp;&nbsp;5. sqlite3-ruby 1.0.0 (mswin32)  
&nbsp;&nbsp;6. sqlite3-ruby 1.0.0 (ruby)  
&nbsp;&nbsp;7. sqlite3-ruby 0.9.0 (ruby)  
&nbsp;&nbsp;8. sqlite3-ruby 0.9.0 (mswin32)  
&nbsp;&nbsp;9. sqlite3-ruby 0.6.0 (ruby)  
&nbsp;&nbsp;10. sqlite3-ruby 0.5.0 (ruby)  
&nbsp;&nbsp;11. Cancel installation  
\>

James

> **···**
>
> --
> 
> [http://www.ruby-doc.org](http://www.ruby-doc.org) - The Ruby Documentation Site  
> [http://www.rubyxml.com](http://www.rubyxml.com) - News, Articles, and Listings for Ruby & XML  
> [http://www.rubystuff.com](http://www.rubystuff.com) - The Ruby Store for Ruby Stuff  
> [http://www.jamesbritt.com](http://www.jamesbritt.com) - Playing with Better Toys

---

<div class="post-metadata">

**Author:** ![Jeff\_Wood](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@Jeff\_Wood](https://rubytalk.org/u/Jeff_Wood)\
**Post date:** [5 October 2005 18:35 UTC](https://rubytalk.org/t/sqlite-ruby-on-windows/21232/8 "2005-10-05T18:35:56Z")

</div>

system32 is the normal place that the system will go looking for DLLs ...  
that's how windows works.

if you want to try and go around that, have fun. what I suggested \*will\*  
work.

And if I wasn't serious ... then why would I post it?

j.

> **···**
>
> On 10/5/05, david@vallner.net \<david@vallner.net\> wrote:
> 
> > \*blush\* Silly me didn't notice the mswin binary distro of the extension.
> > 
> > Citát Jeff Wood \<jeff.darklight@gmail.com\>:
> > 
> > \> There are three phases:  
> > \>  
> > \> #1 - Collect underpants  
> > \> #2 - ??  
> > \> #3 - Profit!
> > 
> > I -am- intrugued now 😜
> > 
> > \>  
> > \> just kidding ...
> > 
> > Awww...
> > 
> > \>  
> > \> Unzip and install the resulting files into your C:\Windows\System32  
> > \> directory
> > 
> > I sincerely hope you're not serious, there's enough banter in that  
> > directory  
> > already. I'll have to womble about the ruby installation dir to find out  
> > where  
> > does windows look for DLLs, or just hack PATH to include a suitable  
> > location  
> > before running the script.
> > 
> > Cheers anyway, that should make the DBMS 301 assignment insanely easier,  
> > what  
> > with being able to deploy without installing anything.
> 
> --  
> "[http://ruby-lang.org](http://ruby-lang.org) -- do you ruby?"
> 
> Jeff Wood

---

<div class="post-metadata">

**Author:** ![basi](https://avatars.discourse-cdn.com/v4/letter/b/a3d4f5/32.png) [@basi](https://rubytalk.org/u/basi)\
**Post date:** [1 October 2005 15:16 UTC](https://rubytalk.org/t/sqlite-ruby-on-windows/21232/9 "2005-10-01T15:16:47Z")

</div>

That works.  
thanks!  
basi

---

<div class="post-metadata">

**Author:** ![basi](https://avatars.discourse-cdn.com/v4/letter/b/a3d4f5/32.png) [@basi](https://rubytalk.org/u/basi)\
**Post date:** [1 October 2005 15:26 UTC](https://rubytalk.org/t/sqlite-ruby-on-windows/21232/10 "2005-10-01T15:26:45Z")

</div>

Install completed, however, when requiring, I get this:

irb(main):001:0\> require 'sqlite3'  
=\> false  
irb(main):002:0\> require 'sqlite3-ruby'  
LoadError: No such file to load -- sqlite3-ruby  
&nbsp;&nbsp;from c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:21:in  
`require\_\_'  
&nbsp;&nbsp;from c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:21:in  
`require'  
&nbsp;&nbsp;from (irb):2  
&nbsp;&nbsp;from  
c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0-mswin32/lib/sqlite3/database.rb:237  
irb(main):003:0\>

---

<div class="post-metadata">

**Author:** ![David\_Vallner](https://avatars.discourse-cdn.com/v4/letter/d/eb9ed0/32.png) [@David\_Vallner](https://rubytalk.org/u/David_Vallner)\
**Post date:** [7 October 2005 08:36 UTC](https://rubytalk.org/t/sqlite-ruby-on-windows/21232/11 "2005-10-07T08:36:15Z")

</div>

Citát Jeff Wood \<jeff.darklight@gmail.com\>:

> system32 is the normal place that the system will go looking for DLLs ...  
> that's how windows works.

Not since Win2K it isn't, apparently. I confirmed my hunch I read about that in  
some documentation. The NT branch of Windows also looks for DLLs in directories  
in the PATH environment variable. And possibly in the location of the  
executable as well, I haven't tried that.

> if you want to try and go around that, have fun. what I suggested \*will\*  
> work.

Not on machines I don't have admin privileges on.

So, I guess this is another bit of useless trivia floating around ruby-talk,  
anyone deploying applications with DLL dependencies in war conditions might  
actually use this.

Aaanyways, thanks again, SQLite works like a charm, and I'm getting ready to  
wear my Ruby slippers to school for the first time. Wish me luck Fighting The  
System.

David Vallner

PS: The bit about not benig serious was tongue-in-cheek...

---

<div class="post-metadata">

**Author:** ![Austin\_Ziegler5](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/austin_ziegler5/32/1985_2.png) [@Austin\_Ziegler5](https://rubytalk.org/u/Austin_Ziegler5)\
**Post date:** [1 October 2005 17:56 UTC](https://rubytalk.org/t/sqlite-ruby-on-windows/21232/12 "2005-10-01T17:56:32Z")

</div>

> Install completed, however, when requiring, I get this:
> 
> irb(main):001:0\> require 'sqlite3'  
> =\> false

This part is probably because of a bug in RubyGems that I \*think\* is  
being looked at.

Check to see if the Sqlite3 constant (I \*think\* that's the one) has been added.

> irb(main):002:0\> require 'sqlite3-ruby'  
> LoadError: No such file to load -- sqlite3-ruby

This is the name of the gem, not the item to require.

-austin

> **···**
>
> On 10/1/05, basi \<basi\_lio@hotmail.com\> wrote:  
> --  
> Austin Ziegler \* halostatue@gmail.com  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\* Alternate: austin@halostatue.ca
