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 ?
Hello,
Thanks for your reply.
I am actualy wanted to use this -
README.rdoc.
Regards,
Arup R.
On Monday, 5 May 2014 10:31 PM, Panagiotis A.
[email protected] wrote:
On 5 Μαϊ 2014, at 18:32 , Arup R. [email protected]
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 *
-
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:[email protected]
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 R. [email protected]
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: [email protected]
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 14-05-05, 10:33, Arup R. wrote:
Hello,
Thanks for your reply.
I am actualy wanted to use this -
README.rdoc.
The sequel gem depends on the sqlite3 gem (or other adapters like
mysql2, pg…) for connecting to the database. You need both.
Andrew V.