Questions tagged [sqlite3-ruby]

The low level SQLite3 library for Ruby. This should only be used for questions about using the low level interface directly.

The SQLite3 gem provides low level Ruby bindings to the SQLite3 embedded database.

You must have the SQLite engine installed in order to build this module.

Links:

214 questions
6
votes
4 answers

Rails 3 won't install sqlite3-ruby gem with rvm?

I'm trying out rvm, and installed ruby 1.9.2 and rails 3 with it. I need to re-install the sqlite3-ruby gem (since rvm keeps all gems separate for different versions of ruby). The problem is, when I try, I get: gem install…
J.R.
  • 5,789
  • 11
  • 55
  • 78
6
votes
6 answers

Error with sqlite3 when running bundle install

So I was trying to run bundle install in my newly created Rails app when I got this error: Gem::Ext::BuildError: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r…
joeleba
  • 176
  • 2
  • 10
5
votes
7 answers

How to clear database before seeding in rails

Is there a simple line of code I can include at the top of my seed file to clear out each table before inserting new seed data without running any rake commands to rollback tables or databases? I was thinking something like: [Foo, Bar].each{|class|…
Jesse Novotny
  • 704
  • 7
  • 16
5
votes
2 answers

How to make Ruby on Rails create SQLite database with foreign keys enabled?

I am newbie to Ruby on Rails and I am using SQLite3 as database for my sample project. I am trying to create ordinary one to many relationship between two models (eg. each Product has one Owner, and each Owner can have many Products). This works…
matori82
  • 3,669
  • 9
  • 42
  • 64
4
votes
1 answer

Where are the initialize methods for SQLite3::Database and SQLite3::Statement

I am an experienced programmer learning Ruby (and liking it a lot). I'm working on setting up a database using SQLite3. In order to better learn Ruby, I'm tracing into SQLite3. What I don't understand is, where is the code for #new for the Database…
Will
  • 337
  • 4
  • 15
4
votes
1 answer

Using sqlite3 with Ruby, is there a way to read each row as a hash instead of array?

I am using sqlite3 as follows: db = SQLite3::Database.open "data.db" stm = db.prepare "SELECT * FROM COMPANIES" rs = stm.execute while (row = rs.next) do name = row[1] that is, the row is an array instead of a hash. Is there a way to read it…
nonopolarity
  • 146,324
  • 131
  • 460
  • 740
4
votes
5 answers

Error : 'incompatible library version' sqlite3-1.3.11 in rails

I working on Ubuntu system(16.04). My problem is whenever i setup any rails project and try to run rails s then i got 'incompatible library version' error for sqlite3 something like…
Jiggs
  • 518
  • 7
  • 22
4
votes
4 answers

Sqlite-3 error while running ROR application

When i try to run Ruby on Rails application.... i facing the following error symbol lookup error: /home/user/.rvm/gems/ruby-1.9.2-preview3/gems/sqlite3-ruby-1.3.0/lib/sqlite3/sqlite3_native.so: undefined symbol: sqlite3_initialize I don't know…
palani
  • 4,661
  • 8
  • 31
  • 36
4
votes
1 answer

Where is sqlite3_native.rb in Windows with Ruby 2.0?

Using Ruby 2.0 x64 on Windows. Installed sqlite3 gem by downloading the sqlite3 autoconf sources and compiling. Then I did a gem install sqlite3 --platform=ruby .... However, now when I run rails server, I get the following error. Where is this…
at.
  • 50,922
  • 104
  • 292
  • 461
4
votes
3 answers

Installation of the sqlite3-ruby gem fails

whenever I try to install the gem: gem install sqlite3-ruby I get the following output: D:/Ruby/bin/ruby.exe extconf.rb checking for sqlite3.h... no sqlite3.h is missing. Install SQLite3 from http://www.sqlite.org/ first. *** extconf.rb failed…
user2192677
  • 327
  • 1
  • 5
  • 12
4
votes
3 answers

How do I import a CSV file into an SQLite database with the sqlite3 gem for Ruby

Here's an example of my .CSV file: column1,column2 data,moreData foo,bar cats,dogs Using Ruby and the sqlite3 gem, is there a way to make an SQLite database and import the .CSV data into it?
Username
  • 3,463
  • 11
  • 68
  • 111
3
votes
3 answers

Installing Sqlite3 for Ruby (Mac OSX 10.5.8)

I am following this guide ATM - http://guides.rubyonrails.org/getting_started.html#getting-up-and-running-quickly-with-scaffolding When trying to create a database, I got: Morgans-Computer:blog Morgan$ rake db:create Could not find gem 'sqlite3 (>=…
Morgan Allen
  • 3,291
  • 8
  • 62
  • 86
3
votes
2 answers

problem for SQLite db for jruby

I tried to use SQLite databse for my jruby project. When i tried to install sqlite3 gem getting the following error C:\tibbr\main\community_manager>gem install sqlite3-ruby Building native extensions. This could take a while... ERROR: Error…
3
votes
1 answer

`gem install sqlite3` tells me to `brew install sqlite3`, but it appears to be already installed on my system -- how do I resolve?

Thanks for any help with this issue, I know there's a lot of different threads around ruby sqlite3 gem install issues. However, I'm facing a specific issue, where by all appearances, it seems sqlite3 is installed on my system, yet unable to be found…
twknab
  • 1,741
  • 1
  • 21
  • 35
3
votes
2 answers

Is there are reason I select by a string columns which contains SHA1 hexdigests?

I have an invitations table which looks like this sqlite> .schema invitations CREATE TABLE "invitations" ( "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL , "sender_id" integer , "recipient_email" varchar(255) , "token"…
David Tuite
  • 22,258
  • 25
  • 106
  • 176
1
2
3
14 15