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
3
votes
1 answer

Can't SUM DISTINCT values in Ruby on Rails

I have 4 tables: Users, Workouts, Exercises, and Results. A "User" posts "Results" for "Exercises" which are linked to a single "Workout". But when the user posts results, since there are multiple exercises, results for one workout can be linked…
brianyates
  • 399
  • 3
  • 16
3
votes
1 answer

Database using SQLite3 (Ruby) is not inserting

I am following a tutorial trying to learn the basics of connecting Ruby to a database. Currently, I have a program that receives an sms using twilio, and sends back a message based on what you said. I am trying to store the phone number and many…
Parker Harris
  • 155
  • 1
  • 7
3
votes
1 answer

installing Sqlite3-ruby error

When I tried to install: gem install sqlite3-ruby it shows: Building native extensions. This could take a while... ERROR: Error installing sqlite3-ruby: ERROR: Failed to build gem native extension. /usr/bin/ruby1.8…
Vina
  • 759
  • 3
  • 10
  • 19
3
votes
1 answer

Issues with sqlite3 and heroku

My app is crashing every time I try to get it on Heroku (required for a school project). It works perfectly locally. An error occurred in the application and your page could not be served. Please try again in a few moments. If you are the…
Ken Bigler
  • 587
  • 1
  • 4
  • 15
3
votes
3 answers

Get any id to any user exists in the database

I am new to rails and have a task that asks me to send an invitation for any user to be admin in my magazine here is my piece of code def invite inviteUser = { 'user_id' => current_user.id, 'Magazine_id' => params[:id] } …
LSDrako
  • 63
  • 1
  • 8
3
votes
3 answers

Heroku Application Error when using Heroku create command

I am following a tutorial at http://onemonth.com where I created my rails app. I was asked to use Heroku to get my app live online. I followed the steps for linking my Github account to Heroku via the SSH key. However when I use the command heroku…
Cyzanfar
  • 6,997
  • 9
  • 43
  • 81
3
votes
1 answer

Use Hash with Redundant Items in sqlite3 Bind

I'm trying to run an INSERT query such as the following: Query = "INSERT INTO t (x,y,z) VALUES (:aval,:bval,:cval)" Using the following format, I can use a hash to insert the actual values: db.execute(Query,{"aval" => "1", "bval" => "2", "cval" =>…
Zongi
  • 49
  • 4
2
votes
1 answer

Unexpected substitution of SQL placeholder in this ruby database query

Can someone explain what's happening here? It seems that the placeholding syntax in SQL statement string doesn't work as expected (or, to say it in a different way, it violates the principle of least surprise), and during runtime an unexpected…
Claudio Floreani
  • 2,441
  • 28
  • 34
2
votes
1 answer

no such file to load -- sqlite3/sqlite3_native

I am having trouble trying to run the following ruby script on OSX (Leopard). require 'sqlite3' database = SQLite3::Database.new( "new.database" ) database.execute( "create table sample_table (id INTEGER PRIMARY KEY, sample_text TEXT,…
Flethuseo
  • 5,969
  • 11
  • 47
  • 71
2
votes
3 answers

Rails 3.1 app can't install sqlite3 gem because libraries are out of date

The latest SQLite3 library available on CentOS 5.6 and which is installed is version 3.3.6. It's my understanding that the sqlite3 gem needs version 3.6 or higher. How do I get my app to work with SQLite3 without upgrading the library on my server?…
Lester Peabody
  • 1,868
  • 3
  • 20
  • 42
2
votes
2 answers

Issue with 'gem install sqlite3-ruby' on RHEL6

I'm attempting to install Ruby on Rails 3 on RHEL 6. I've 'yum install' sqlite and sqlite-devel (which is sqlite3 on RHEL6). As you can see, sqlite3.h does exist where it needs to be. 'gem install sqlite3-ruby' still doesn't work, for some…
Adam
  • 161
  • 1
  • 8
2
votes
1 answer

Ruby script can't open SQLite3 file, but only when running as a Daemon

I'm running a script (running on an AWS EC2 instance) that continually pulls state legislative data from an API, and persists it to a SQLite3 .db file. When I try to run the script as a daemon in the background, the process immediately stops and I'm…
FakeBenJay
  • 41
  • 2
2
votes
2 answers

Sqlite3 stores string as hexadecimal

In a Ruby script I need to read some values from an existing g SQLite3 database. DB = SQLite3::Database.open "#{App.root}/db/dm4sea_#{App.env}.db" The database has 1 table (batches) with the following structure DB.execute "PRAGMA…
Sig
  • 5,476
  • 10
  • 49
  • 89
2
votes
1 answer

How to create a new SQLite3 database using Ruby?

I know how to connect to a database in the current file directory: db = SQLite3::Database.new 'Data.db' My question is how do I create a new database in the current file directory? bonus question: what do the two colons means?
the_prole
  • 8,275
  • 16
  • 78
  • 163
2
votes
1 answer

"rake db:migrate" results in "The bundle currently has pg locked at 0.18.4"

I generated this scaffold in Rails. Then I did a "rake db:migrate". Then I got: [31mYou have requested: pg >= 0 The bundle currently has pg locked at 0.18.4. Try running `bundle update pg`[0m [33mRun `bundle install` to install missing…
slave_unit
  • 27
  • 6
1 2
3
14 15