Problem loading a SQLite3 database on Debian 3.1

S

Stephan Kämper

Hi all,

I try to figure out why a small Rails application doesn't run and the
problem seems to be that the DB file apparently can't be opened.
So, yes sqlite3-ruby is installed (via gem) and sqlite3 itself is also
installed and running (the sqlite3 command is available and I can run
select statements etc.).

Only if I try to open that very DB file from Ruby an exception is raised.
I don't think this should be necessary, but I also copied libsqlite3.so
into the $LOAD_PATH - to no avail.

This is on a Debian 3.1 Linux machine.

sqlite3 -version # => 3.3.5
ruby -v # => ruby 1.8.4 (2005-12-24) [i686-linux]



Here's what I get form irb:

irb(main):001:0> require 'English'
=> true
irb(main):002:0> require 'sqlite3'
=> true
irb(main):003:0> $LOAD_PATH
=> ["/usr/local/lib/ruby/site_ruby/1.8",
"/usr/local/lib/ruby/site_ruby/1.8/i686-linux",
"/usr/local/lib/ruby/site_ruby", "/usr/local/lib/ruby/1.8",
"/usr/local/lib/ruby/1.8/i686-linux", "."]
irb(main):004:0> db = SQLite3::Database.new( "example.db3" )
RuntimeError: libsqlite3.so: cannot open shared object file: No such
file or directory
from /usr/local/lib/ruby/1.8/dl/import.rb:29:in `initialize'
from /usr/local/lib/ruby/1.8/dl/import.rb:29:in `dlload'
from /usr/local/lib/ruby/1.8/dl/import.rb:27:in `dlload'
from
/usr/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0/lib/sqlite3/driver/dl/api.rb:63
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from
/usr/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0/lib/sqlite3/driver/dl/driver.rb:33
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from
/usr/local/lib/ruby/site_ruby/1.8/sqlite3/database.rb:642:in `load_driver'
from
/usr/local/lib/ruby/site_ruby/1.8/sqlite3/database.rb:640:in `load_driver'
from
/usr/local/lib/ruby/site_ruby/1.8/sqlite3/database.rb:107:in `initialize'
from (irb):4


Now, I appreciate all ideas how to get this going.

Happy rubying everybody

Stephan
 
D

Dick Davies

irb(main):004:0> db =3D SQLite3::Database.new( "example.db3" )
RuntimeError: libsqlite3.so: cannot open shared object file: No such
file or directory

It's not finding the sqlite library (DLL) and the remaining errors sound li=
ke
it's trying to use the shared lib via ruby/dl.

Try rebuilding the gem so it uses SWIG instead. See the instructions at:

http://code.whytheluckystiff.net/camping/wiki/BeAlertWhenOnSqlite3

--=20
Rasputin :: Jack of All Trades - Master of Nuns
http://number9.hellooperator.net/
 

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,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top