Forum: Ruby LoadError: cannot load such file -- sqlite3 (Sequel::AdapterNotFound)

249c7fd851c5c5ac5a1abdb756472ae1?d=identicon&s=25 Arup Rakshit (my-ruby)
on 2014-05-05 18:36
(Received via mailing list)
Hi All,

I did as below :-

(arup~>~)$ sqlite3 blog
SQLite version 3.8.2 2013-12-06 14:53:30
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>

I installed the gem also :-

(arup~>~)$ gem list | grep sequel
sequel (4.10.0)
(arup~>~)$


Now my code :-

require 'sequel'

DB = Sequel.connect('sqlite://blog.db')

DB.create_table :items do
 primary_key :id
 String :name
 Float :price
end

items = DB[:items] # Create a dataset

# Populate the table
items.insert(:name => 'abc', :price => rand * 100)
items.insert(:name => 'def', :price => rand * 100)
items.insert(:name => 'ghi', :price => rand * 100)

# Print out the number of records
puts "Item count: #{items.count}"


# ~>
/home/kirti/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in
`require': LoadError: cannot load such file -- sqlite3
(Sequel::AdapterNotFound)

Can anyone tell me how to fix this ?
A7fca2db6ff3f4583df98043bd5166f9?d=identicon&s=25 Panagiotis Atmatzidis (Guest)
on 2014-05-05 19:02
(Received via mailing list)
Attachment: signature.asc (832 Bytes)
On 5 Μαϊ 2014, at 18:32 , Arup Rakshit <aruprakshit@rocketmail.com>
wrote:

> I installed the gem also :-
> DB = Sequel.connect('sqlite://blog.db')
> items.insert(:name => 'abc', :price => rand * 100)
>
Code works, you need to install sqlite3 gem (which might be a little
tricky if sqlite3 libs are not in your library paths).

Panagiotis (atmosx) Atmatzidis

email:  atma@convalesco.org
URL:  http://www.convalesco.org
GnuPG ID: 0x1A7BFEC5
gpg --keyserver pgp.mit.edu --recv-keys 1A7BFEC5

"As you set out for Ithaca, hope the voyage is a long one, full of
adventure, full of discovery [...]" - C. P. Cavafy
249c7fd851c5c5ac5a1abdb756472ae1?d=identicon&s=25 Arup Rakshit (my-ruby)
on 2014-05-05 19:37
(Received via mailing list)
Hello,

Thanks for your reply.

I am actualy wanted to use this -
http://sequel.jeremyevans.net/rdoc/files/README_rdoc.html.
 
Regards,
Arup Rakshit
On Monday, 5 May 2014 10:31 PM, Panagiotis Atmatzidis
<atma@convalesco.org> wrote:



On 5 Μαϊ 2014, at 18:32 , Arup Rakshit <aruprakshit@rocketmail.com>
wrote:

Hi All,
>
>
>I did as below :-
>
>
>(arup~>~)$ sqlite3 blog
>SQLite version 3.8.2 2013-12-06 14:53:30
>Enter ".help" for instructions
>Enter SQL statements
 terminated with a ";"
>
>Now my code
 :-
>end
>
>items = DB[:items] # Create a dataset
>
># Populate the table
>items.insert(:name => 'abc', :price => rand * 100)
>items.insert(:name => 'def', :price => rand *
 100)
>
>
>

Code works, you need to install sqlite3 gem (which might be a little
tricky if sqlite3 libs are not in your library paths).

Panagiotis (atmosx) Atmatzidis

email:atma@convalesco.org
URL:http://www.convalesco.org
GnuPG ID: 0x1A7BFEC5
gpg --keyserver pgp.mit.edu --recv-keys 1A7BFEC5

"As you set out for Ithaca, hope the voyage is a long one, full of
adventure, full of discovery [...]" - C. P. Cavafy
F0987c97234fa9c6b26f796bdbdab037?d=identicon&s=25 Andrew Vit (Guest)
on 2014-05-05 19:47
(Received via mailing list)
On 14-05-05, 10:33, Arup Rakshit wrote:
> Hello,
>
> Thanks for your reply.
>
> I am actualy wanted to use this -
> http://sequel.jeremyevans.net/rdoc/files/README_rdoc.html.

The sequel gem depends on the sqlite3 gem (or other adapters like
mysql2, pg...) for connecting to the database. You need both.

Andrew Vit
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.