views:

601

answers:

4

Hi,

I have problem with sqlite3, because it is not working.

irb(main):001:0> require 'sqlite3'
LoadError: no such file to load -- sqlite3
    from (irb):1:in `require'
    from (irb):1
    from /usr/bin/irb:12:in `<main>'

I have installed following packages:

sudo apt-get install ruby1.9.1-full
sudo apt-get install rubygems1.9.1
sudo gem update --system

sudo apt-get install sqlite3 libsqlite3-dev
sudo gem install sqlite3-ruby
sudo apt-get install libopenssl-ruby1.9.1

The applications has following versions:

$ ruby --version
ruby 1.9.1p243 (2009-07-16 revision 24175) [x86_64-linux]
$ sqlite3 --version
3.6.16
$ gem --version
1.3.6

and

$ gem list --local

*** LOCAL GEMS ***

actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activeresource (2.3.5)
activesupport (2.3.5)
ffi (0.6.2)
rack (1.0.1)
rails (2.3.5)
rake (0.8.7)
rubygems-update (1.3.6)
sqlite3-ruby (1.2.5)

What have I missed?

I forget to mention that this is not working for rails also:

$ rake db:create
(in /home/doriath/test)
rake aborted!
no such file to load -- sqlite3

(See full trace by running task with --trace)
A: 
require 'rubygems'
require 'sqlite3'
tliff
Unfortunately this is not working.
doriath
A: 

Try to install sqlite3 gem ( not sqlite3-ruby ). sqlite for ruby 1.9 as sqlite3-ruby for ruby 1.8

uzzz
A: 

Set your GEM_HOME to point to the correct place; for me, it's:

export GEM_HOME="/usr/lib/ruby1.9.1/gems/1.9.1"

Note that if you put this in a .bashrc, you'll get bitten when you run sudo, since the env var won't be defined there

Paul Betts
A: 

gem install sqlite3

denisjacquemin