Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SQLite / Ruby on Windows?

0 views
Skip to first unread message

da...@vallner.net

unread,
Sep 30, 2005, 9:49:33 AM9/30/05
to
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


Austin Ziegler

unread,
Sep 30, 2005, 10:14:14 AM9/30/05
to

Try installing it with RubyGems.

-austin
--
Austin Ziegler * halos...@gmail.com
* Alternate: aus...@halostatue.ca


Jeff Wood

unread,
Sep 30, 2005, 12:20:38 PM9/30/05
to
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
#2 Download 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.


--
"http://ruby-lang.org -- do you ruby?"

Jeff Wood

basi

unread,
Sep 30, 2005, 11:44:06 PM9/30/05
to
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
> #2 Download 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

x1

unread,
Sep 30, 2005, 11:53:04 PM9/30/05
to
try, gem install sqlite3-ruby

James Britt

unread,
Oct 1, 2005, 2:04:34 AM10/1/05
to
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)
1. sqlite3-ruby 1.1.0 (ruby)
2. sqlite3-ruby 1.1.0 (mswin32)
3. sqlite3-ruby 1.0.1 (ruby)
4. sqlite3-ruby 1.0.1 (mswin32)
5. sqlite3-ruby 1.0.0 (mswin32)
6. sqlite3-ruby 1.0.0 (ruby)
7. sqlite3-ruby 0.9.0 (ruby)
8. sqlite3-ruby 0.9.0 (mswin32)
9. sqlite3-ruby 0.6.0 (ruby)
10. sqlite3-ruby 0.5.0 (ruby)
11. Cancel installation
>

James
--

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


basi

unread,
Oct 1, 2005, 11:15:26 AM10/1/05
to
That works.
thanks!
basi

basi

unread,
Oct 1, 2005, 11:22:57 AM10/1/05
to
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
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
`require__'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
`require'
from (irb):2
from
c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0-mswin32/lib/sqlite3/database.rb:237
irb(main):003:0>

Austin Ziegler

unread,
Oct 1, 2005, 1:56:32 PM10/1/05
to
On 10/1/05, basi <basi...@hotmail.com> wrote:
> 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.

da...@vallner.net

unread,
Oct 5, 2005, 1:54:37 PM10/5/05
to
*blush* Silly me didn't notice the mswin binary distro of the extension.

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

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

I -am- intrugued now ;P

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


Jeff Wood

unread,
Oct 5, 2005, 2:35:56 PM10/5/05
to
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.

da...@vallner.net

unread,
Oct 7, 2005, 4:36:15 AM10/7/05
to
Citát Jeff Wood <jeff.da...@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...


0 new messages