# Problem loading a SQLite3 database on Debian 3.1

**URL:** <https://www.ruby-forum.com/t/problem-loading-a-sqlite3-database-on-debian-3-1/99833>\
**Category:** Ruby\
**Created:** [July 25, 2006, 9:23pm UTC](https://www.ruby-forum.com/t/problem-loading-a-sqlite3-database-on-debian-3-1/99833 "2006-07-25T21:23:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephan\_KSSS\_mper](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/958977/32.png) [@Stephan\_KSSS\_mper](https://www.ruby-forum.com/u/Stephan_KSSS_mper)\
**Post date:** [July 25, 2006, 9:23pm UTC](https://www.ruby-forum.com/t/problem-loading-a-sqlite3-database-on-debian-3-1/99833/1 "2006-07-25T21:23:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Stephan\_KSSS\_mper](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/958977/32.png) [@Stephan\_KSSS\_mper](https://www.ruby-forum.com/u/Stephan_KSSS_mper)\
**Post date:** [July 26, 2006, 10:01am UTC](https://www.ruby-forum.com/t/problem-loading-a-sqlite3-database-on-debian-3-1/99833/2 "2006-07-26T10:01:17Z")

</div>

On 25/07/06, Stephan Kämper [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> irb(main):004:0\> db = 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  
like  
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](http://code.whytheluckystiff.net/camping/wiki/BeAlertWhenOnSqlite3)

---

<div class="post-metadata">

**Author:** ![Stephan\_KSSS\_mper](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/958977/32.png) [@Stephan\_KSSS\_mper](https://www.ruby-forum.com/u/Stephan_KSSS_mper)\
**Post date:** [July 26, 2006, 9:30pm UTC](https://www.ruby-forum.com/t/problem-loading-a-sqlite3-database-on-debian-3-1/99833/3 "2006-07-26T21:30:30Z")

</div>

Dick D. wrote:

> Try rebuilding the gem so it uses SWIG instead. See the instructions at:
> 
> [http://code.whytheluckystiff.net/camping/wiki/BeAlertWhenOnSqlite3](http://code.whytheluckystiff.net/camping/wiki/BeAlertWhenOnSqlite3)

Thanks a lot. This is it.

Happy rubying

Stephan
