Trouble with Gems and SQLite under Windows

S

Steve

Hi,

I am trying to learn Ruby and having a problem that doesn't make any
sense. I have installed Ruby with the installer and installed the sqlite
gem for win32. In my gems directory I have sqlite3-ruby-1.1.0-mswin32 so
I assume it installed fine. I have read the FAQ for the SQLite module
and written the following code:

require 'sqlite'

db = SQLite::Database.new("test.db")

sql = <<SQL
create table the_table (
a varchar2(30),
b varchar2(30)
);

insert into the_table values ( 'one', 'two' );
insert into the_table values ( 'three', 'four' );
insert into the_table values ( 'five', 'six' );
SQL

db.execute_batch( sql )

However when I run it via "ruby db.rb" I get the following error:

C:\Temp>ruby db.rb
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
`require__': No such file to load -- sqlite (LoadError)
from
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `re
quire'
from db.rb:1

Any ideas on what is wrong???
 
J

Jamis Buck

Hi,

I am trying to learn Ruby and having a problem that doesn't make
any sense. I have installed Ruby with the installer and installed
the sqlite gem for win32. In my gems directory I have sqlite3-
ruby-1.1.0-mswin32 so I assume it installed fine. I have read the
FAQ for the SQLite module and written the following code:

require 'sqlite'

This ought to be 'sqlite3', if you are using the sqlite3 gem. See if
that works for you.

- Jamis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,089
Latest member
Ketologenic

Latest Threads

Top