sqlite3

83 views
Skip to first unread message

Liam Hoekenga

unread,
Jun 25, 2008, 12:06:01 PM6/25/08
to rubyonra...@googlegroups.com
If I install sqlite3-ruby using gem, I get this error..

LoadError: no such file to load -- sqlite3/database

I saw this post..

http://www.ruby-forum.com/topic/144703#641008

And it seems that this is most commonly a problem if people don't have
the sqlite3 libraries and headers installed when they build the
sqlite3-ruby module. I've got those.

"gem install sqlite3-ruby" only populates

/usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.2

but if I download the gem from rubyforge, and build and install it by
hand, it puts stuff in both...

/usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.2
/usr/lib/ruby/site_ruby/1.8/sqlite3

and creates /usr/lib/ruby/site_ruby/1.8/i686-linux/sqlite3_api.so..
which takes of the "LoadError: no such file to load..." problem.

Any ideas why installing sqlite3 via gem doesn't work, but building it
by hand does?
--
Posted via http://www.ruby-forum.com/.

Bobnation

unread,
Jun 26, 2008, 10:12:03 AM6/26/08
to Ruby on Rails: Talk
What platform are you running this on?

On Jun 25, 11:06 am, Liam Hoekenga <rails-mailing-l...@andreas-s.net>
wrote:

Liam Hoekenga

unread,
Jun 26, 2008, 10:19:03 AM6/26/08
to rubyonra...@googlegroups.com
We're using a locally developed LFS based linux distribution. No easy
access to widely used package management (yum, apt, rpm).

I do have ruby 1.8.6 (not p230 - that was causing issues). Linux
2.6.23.1, glibc 2.3.6, sqlite 3.5.9 installed from source.

As far as I know, the other gems we're using are working ok.

Bobnation

unread,
Jun 26, 2008, 11:05:09 AM6/26/08
to Ruby on Rails: Talk
Hhmm ... it seems like something is missing to me with the install.
I'm not sure if there is something ruby might be missing?

On Jun 26, 9:19 am, Liam Hoekenga <rails-mailing-l...@andreas-s.net>
wrote:

Liam Hoekenga

unread,
Jun 26, 2008, 11:12:16 AM6/26/08
to rubyonra...@googlegroups.com
Oh yeah.. this is Rails 2.1.

Frederick Cheung

unread,
Jun 26, 2008, 11:29:59 AM6/26/08
to rubyonra...@googlegroups.com

On 26 Jun 2008, at 16:12, Liam Hoekenga wrote:

>
> Oh yeah.. this is Rails 2.1.

when you built the gem did you tell it where to find the sqlite
headers. Did it print the 'building native extension' blurb ?

Fred

Liam Hoekenga

unread,
Jun 26, 2008, 3:33:29 PM6/26/08
to rubyonra...@googlegroups.com
Yup..

# gem install sqlite3-ruby
Building native extensions. This could take a while...
Successfully installed sqlite3-ruby-1.2.2
1 gem installed
Installing ri documentation for sqlite3-ruby-1.2.2...
Installing RDoc documentation for sqlite3-ruby-1.2.2...

Ivan V.

unread,
Jun 26, 2008, 6:35:13 PM6/26/08
to rubyonra...@googlegroups.com
Liam Hoekenga wrote:
> Yup..
>
> # gem install sqlite3-ruby
> Building native extensions. This could take a while...
> Successfully installed sqlite3-ruby-1.2.2
> 1 gem installed
> Installing ri documentation for sqlite3-ruby-1.2.2...
> Installing RDoc documentation for sqlite3-ruby-1.2.2...

That specific error happened to me on Ubuntu, and I had to install
libsqlite3-ruby. I know you don't have access to packages, but maybe you
can look into that package's content to figure out what you need.

Greg Donald

unread,
Jun 26, 2008, 11:55:41 PM6/26/08
to rubyonra...@googlegroups.com
On Thu, Jun 26, 2008 at 9:12 AM, Bobnation <boblm...@gmail.com> wrote:
> LoadError: no such file to load -- sqlite3/database

I found this evening that I have this same issue on a new Debian install.

> dpkg -l|grep sqlite3
ii libsqlite3-0 3.3.8-1.1
SQLite 3 shared library
ii libsqlite3-dev 3.3.8-1.1
SQLite 3 development files
ii libsqlite3-ruby 1.1.0-2
SQLite3 interface for Ruby
ii libsqlite3-ruby1.8 1.1.0-2
SQLite3 interface for Ruby 1.8
ii sqlite3 3.3.8-1.1
A command line interface for SQLite 3

> gem list --local
actionmailer (2.1.0)
actionpack (2.1.0)
activerecord (2.1.0)
activeresource (2.1.0)
activesupport (2.1.0)
hoe (1.6.0)
mysql (2.7)
paginator (1.1.1)
rails (2.1.0)
rake (0.8.1)
rcov (0.8.1.2.0)
rubyforge (1.0.0)
sqlite3-ruby (1.2.2)

> ruby -v
ruby 1.8.7 (2008-06-20 patchlevel 22) [i686-linux]

> uname -a
Linux mercury 2.6.18-4-686 #1 SMP Wed May 9 23:03:12 UTC 2007 i686 GNU/Linux


--
Greg Donald
http://destiney.com/

Greg Donald

unread,
Jun 29, 2008, 1:21:39 AM6/29/08
to rubyonra...@googlegroups.com
On Thu, Jun 26, 2008 at 10:55 PM, Greg Donald <gdo...@gmail.com> wrote:
> On Thu, Jun 26, 2008 at 9:12 AM, Bobnation <boblm...@gmail.com> wrote:
>> LoadError: no such file to load -- sqlite3/database
>
> I found this evening that I have this same issue on a new Debian install.
>
> sqlite3-ruby (1.2.2)

An older version seems to work.

gem uninstall sqlite3-ruby

gem install sqlite3-ruby -v=1.2.1

Liam Hoekenga

unread,
Jun 30, 2008, 11:07:52 AM6/30/08
to rubyonra...@googlegroups.com
I find I get a /more/ complete installation when I install 1.2.1 via
gem, but still not functional.

The only method that really seems to work for me is to download the gem
from rubyforge and to build and install it by hand. :\

brian doll

unread,
Jul 15, 2008, 8:08:00 PM7/15/08
to Ruby on Rails: Talk
Thanks for the suggestions! On a Mac (10.4.11) I was having this
issue with a new Rails 2.1 app. Downgrading to 1.2.1 worked
perfectly.


On Jun 28, 10:21 pm, "Greg Donald" <gdon...@gmail.com> wrote:
> On Thu, Jun 26, 2008 at 10:55 PM, Greg Donald <gdon...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages