Effective Internet Marketing Strategy and Tactics Through Test

Rails 2.1.0 Fails With Sqlite3 on Debian

If this page is useful, please click the "+1" button

Published on July 28th, 2008 by Jeremy Chatfield

I’ve tried this on OS X (Leopard) having done the update dance recommended by Apple. I’ve done the Debian 4.0 update dance and installed various packages for compilation – including libsqlite3-ruby. After the updates, the rev levels are different and that’s pretty suspicious.

Both OS X and Debian have rails 2.1.0, ruby 1.8.5 (Debian) and 1.8.6 (Mac OS X), sqlite3 3.3.0 (Debian) and 3.4.0 (Mac OS X).

Use the following commands on each:

rails test
cd test
script/generate scaffold testaroo qing:text jing:string
rake db:migrate

Works just fine on OS X. On Debian I get:


~/src/test$ rake db:migrate
(in /home/jdc/src/test)
rake aborted!
Could not find table 'testaroo'

The config/databas.yml file is identical on OS X and Debian - I've extracted just the development section:


# SQLite version 3.x
# gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
adapter: sqlite3
database: db/development.sqlite3
timeout: 5000

And the db directory on both systems is the same, with a "development.sqlite3" file and the migrate directory. The schema file... that's where the problem is. The OS X version of this file includes the following lines:


create_table "testarees", :force => true do |t|
t.text "ming"
t.string "qing"
t.datetime "created_at"
t.datetime "updated_at"
end

Those lines are missing from the Debian version. I've seen quite a few questions about problems with the db:migrate showing missing tables, and none of them that I've read, have pointed at the schema as being the problem.

At a wild guess, the downrev Ruby causes some kind of problem that prevents addng the pseudo-SQL code. Tracking into this level has already taken hours. If anyone has a clue, or can nominate a high S/N forum to post, that'd be nice.

As it is, I'll develop on Mac, and see if I can deploy on Debian - but I might force an upgrade to Ruby 1.8.6, just in case that's it.

"Rails 2.1.0 Fails With Sqlite3 on Debian" was published on July 28th, 2008 and is listed in programming, rails.

Follow comments via the RSS Feed | Leave a comment

Rails 2.1.0 Fails With Sqlite3 on Debian: 4 Comments

  1. elvis wrote,

    This will resolve your issue:
    http://www.icoretech.org/2008/07/06/no-such-file-to-load-sqlite3-database

  2. Rob Cameron wrote,

    Ever find a solution for this? I’m getting the same thing, Rails 2.1 on Debian. :( I’ve updated the sqlite3-ruby gem to 1.2.4 but that didn’t help. I know the damn table exists, I can open the database with the sqlite3 command line and select/insert records … what the hell??

  3. Jeremy Chatfield wrote,

    Hi Rob, I’m not convinced by elvis’ fix, in the previous comment. OTOH, I’m now developing with 2.1.1 on Mac OS. I’m testing and deploying with Postgres on Linux – no apparent problems, so far. Just a mild sense of disappointment that, given integrated unit testing, this wasn’t nailed by someone who actually knows Ruby. I’m still a rank beginner :(

  4. jlnr wrote,

    In case anyone else comes to this post while googling for Debian and SQLite and all that, you probably have this forum, and the easy workaround is in the comments:

    http://rails.lighthouseapp.com/projects/8994/tickets/99-sqlite-connection-failing-2

Got a question or want to dispute this?

Is this article any good? What helped you? What made you think it was wrong? What else would you like to know or discuss?

free debate

Merjis Internet Marketing Blog is powered by WordPress and the YUI-Mainstream Theme by Buzzdroid.comBoosted by FeedBurner