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

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 ";"

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 ?

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

···

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 ";"
>

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 ?

Hello,

Thanks for your reply.

I am actualy wanted to use this - http://sequel.jeremyevans.net/rdoc/files/README_rdoc.html\.

Regards,
Arup Rakshit

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 ";"

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 ?

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

···

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:

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

Andrew Vit

···

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\.