Strangeness with ruby-web and sqlite3

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

Hi Harold,

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

cheers

Simon

Man, good guess.

Thanks a million!

-Harold

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs