Strangeness with ruby-web and sqlite3

H

Harold Hausman

Hello everyone,

I'm getting everything up and running on win32 with ruby-web and
sqlite3. I've gotten quite far and everything was going even smoother
than expected until I ran into the strangeness I'm seeing now and I
just can figure out whats going on.

From my .rb cgi script I can select from the db just fine by doing things like:

db = SQLite3::Database.new( "test1" )
$theUsers = db.execute( "select * from users" )
db.close

But, when I try to insert or delete by doing something like:

db = SQLite3::Database.new( "test1" )
db.execute( "insert into users values( 5, 'Harold' )" )
db.close

or:

db = SQLite3::Database.new( "test1" )
db.execute( "delete from users where id = 2" )
db.close

It raises the following exception:
SQLite3::SQLException
SQL logic error or missing database

This is highly befuddling to me because all of my interactions with
the database work fine in irb, that is to say that the lines of code
that are failing when run as a cgi under ruby-web don't fail (read:
work) when typed in by hand to irb. I've been able to insert and
delete like a mad man by hand, but when the web-app tries it it fails.

Anyone heard of or seen anything like this before?

Thanks in advance,
-Harold
 
K

Kroeger, Simon (ext)

Hi Harold,

just a guess: is your html-server account allowed to write
that database file?

cheers

Simon
 
H

Harold Hausman

Man, good guess.

Thanks a million!

-Harold

Hi Harold,

just a guess: is your html-server account allowed to write
that database file?

cheers

Simon
From: Harold Hausman [mailto:[email protected]]
Sent: Monday, July 17, 2006 2:26 PM

Hello everyone,

I'm getting everything up and running on win32 with ruby-web and
sqlite3. I've gotten quite far and everything was going even smoother
than expected until I ran into the strangeness I'm seeing now and I
just can figure out whats going on.

From my .rb cgi script I can select from the db just fine by
doing things like:

db = SQLite3::Database.new( "test1" )
$theUsers = db.execute( "select * from users" )
db.close

But, when I try to insert or delete by doing something like:

db = SQLite3::Database.new( "test1" )
db.execute( "insert into users values( 5, 'Harold' )" )
db.close

or:

db = SQLite3::Database.new( "test1" )
db.execute( "delete from users where id = 2" )
db.close

It raises the following exception:
SQLite3::SQLException
SQL logic error or missing database

This is highly befuddling to me because all of my interactions with
the database work fine in irb, that is to say that the lines of code
that are failing when run as a cgi under ruby-web don't fail (read:
work) when typed in by hand to irb. I've been able to insert and
delete like a mad man by hand, but when the web-app tries it it fails.

Anyone heard of or seen anything like this before?

Thanks in advance,
-Harold
 

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,995
Messages
2,570,228
Members
46,817
Latest member
AdalbertoT

Latest Threads

Top