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
1
vote
1 answer

syntax error when attempting to use bind vars in SQL queries in Ruby

I am using sqlite3 and attempting to pass bind variables into SQL statements in a command line application that I'm attempting as a replication of http://www.pangloss.com/seidel/shake_rule.html . This is the management utility for adding/removing…
Alex Nye
  • 147
  • 8
1
vote
1 answer

Location of Sqlite databases in OSX

Im learning Ruby on Rails 3 and would like to see the db structures created by various Scaffold commands in Sqlite3 in order to understand more the process. In OSX Snow Leopard, entering: which sqlite3 yields: "/usr/local/bin/sqlite3" However cant…
angus
  • 11
  • 1
  • 2
1
vote
1 answer

Capistrano Rails app SQLite3 Cannot open Database

I've managed to get a Rails app deployed with Capistrano to a server running NGinx & Passenger. On deploy I was getting the "We're sorry, something went wrong" message & was rather confused as the production log was blank. I then switched the…
Jack Franklin
  • 3,765
  • 6
  • 26
  • 34
1
vote
1 answer

Error installing gem sqlite3 - centos5.6

I'm trying to install the sqlite3 gem for ruby on rails and am getting this error... I've already successfully installed sqlite3 via yum. Building native extensions. This could take a while... ERROR: Error installing sqlite3: ERROR: Failed to…
Jake
  • 13
  • 4
0
votes
1 answer

In ruby on rails Is there a way to dictate the format of fields inserted into the database via Activerecord?

I'm inserting some strings (that look dates) into a sqlite3 database via my ActiveRecord and the database is altering the field and making it look like a date. For example: "4-2" => "2-Apr" #Not only a date but the order has been…
Mutuelinvestor
  • 3,384
  • 10
  • 44
  • 75
0
votes
1 answer

Update action fire an insert query?

Hi i know it's silly but true i got this when i edit any entry. I have an expense model and an expense_line_item and a paid_line_item model, it is created properly when i create a new entry but on editing previous entry it adds a new entry instead…
Ravindra
  • 1,039
  • 2
  • 12
  • 26
0
votes
0 answers

Inserted records are disappearing shortly after insertion

I'm seeing some odd behaviour when inserting records to a table of a sqlite DB in a Ruby application. I have an application that fetches data from a series of API's, manipulates it and stitches it back together before inserting to a sqlite…
Bill Dukelow
  • 464
  • 4
  • 21
0
votes
3 answers

Find and sort all the data(dates) after a certain date by month/day and not year in SQLite

I wanna order the data in an sqlite3 database by date. (Day and Month to be precise) I have a table, the data in the table are in the format YYYY-MM-DD 2003-02-20, 2005-07-16, 2008-11-18, 1998-01-02, 1996-08-27 Here, I wanna find all the data after…
Mansss
  • 1
  • 1
0
votes
0 answers

Rails add multiple columns after a specific column using sqlite3

I've generated Devise for User and now I want to add multiple columns after the email column: class AddColumnsToUser < ActiveRecord::Migration[7.0] def change add_column :users, :name, :string, after: :email add_column :users, :surname,…
Daniel
  • 1
0
votes
1 answer

App doesnt run rake commands when deployed to heroku

in my development are the app works fine but when i deploy to heroku and try to run rake db:migrate to build the database, it aborts and says wrong number of arguments. i have searched all over the web but could not fix it. here is the error $…
0
votes
0 answers

StatementInvalid: SQLite3::BusyException: database is locked

I have referred various answers on StackOverflow but I still haven't been able to resolve this issue. I am sharing the code for my controllers_test.rb and along with that the screenshot. Every time I run rails test, the following error is shown. I…
0
votes
1 answer

Why postgres is not used in development?

I have encountered this in my Gemfile while learning ruby on rails: group :development, :test do gem 'sqlite3', '~> 1.4' group :production do gem 'pg' So far I have understood that sqlite3 is not a production-ready database as it does not…
0
votes
1 answer

sqlite3 ruby-gem causes undefined symbol rb_check_safe_obj on execution

I am leveraging sqlite3 and active-record. On my local machine everything works as expected. However, when attempting to read from the database on a new debian deployment i get the following error : ruby: symbol lookup error:…
diedthreetimes
  • 4,086
  • 26
  • 38
0
votes
1 answer

bundle install on ruby on rails throwing mingw32 error

I'm very new on ruby and trying to install it for the first time on my machine my it's giving me these error i've already installed sqlite3 on my machine I don't know what is the cause please help warning: Public keyring not found; have you run…
mustafa
  • 33
  • 1
  • 7
0
votes
1 answer

Rails - How to handle database connectivity and gracefully inform the user that database is unreachable

I am working on a rails 5 API that has SQLite3 database. Even though the database file is stored locally, I want to create my own exception handling in case the database file is not accessible, e.g. deleted. I actually want all such errors, that are…
Hussain Niazi
  • 579
  • 1
  • 3
  • 21