Michael Artz
2006-Aug-15 00:49 UTC
[sqlite-ruby-users] unable to open database with absolute path
I''m trying to install sqlite-ruby on a cygwin box. I''ve
successfully
built sqlite-2.8.17 into /usr/local/ and the command line sqlite seems
to work just fine. I installed the gem with the following command:
gem install sqlite-ruby -- --with-sqlite-lib=/usr/local/lib
--with-sqlite-include=/usr/local/include
and chose option 1, sqlite-ruby 2.2.3 (ruby), which also seemed to
build and install just fine.
Everything seemed to work fine, and I fired up irb to test it out.
When I open a db file with a relative path, everything seems to work
just fine. However, when I use an absoute path for the same file, I
get an exception. Any ideas what could be going wrong?
Thanks
-Mike
$ cd /tmp
$ irb
irb(main):001:0> require ''rubygems''
=> true
irb(main):003:0> require_gem ''sqlite-ruby''
=> true
irb(main):006:0> db = SQLite::Database.new(''testdb'')
=> #<SQLite::Database:0x49259b8 @results_as_hash=false, @closed=false,
@translator=nil, @handle=#<Data:0x4925958>, @type_translation=false>
irb(main):008:0> db2 = SQLite::Database.new(''/tmp/testdb'')
SQLite::Exceptions::DatabaseException: unable to open database: /tmp/testdb
from
/usr/lib/ruby/gems/1.8/gems/sqlite-ruby-2.2.3/lib/sqlite/database.rb:119:in
`open''
from
/usr/lib/ruby/gems/1.8/gems/sqlite-ruby-2.2.3/lib/sqlite/database.rb:119:in
`initialize''
from (irb):8
irb(main):009:0>