Topic: SQLite3 version problem

I'm on Mac OS X 10.4.10, which comes with SQLite3 3.1.3.  I've read that Apple uses it for some OS X internal applications.  Anyway, I've been handed a project that uses ajax_scaffold and active_scaffold (part of my job is to replace all of the old ajax_scaffold calls with active_scaffold).  The active scaffolding code makes use SELECT COUNT(DISTINCT ...), which was added in SQLite3 3.2.6.  So I've been trying to figure out how to upgrade to a more recent version.

I installed Fink and finally managed to get SQLite3 3.2.8 installed into /sw/bin, and if I do "which sqlite3", it reports /sw/bin/sqlite3.  If I do "sqlite3 -version", it reports 3.2.8.  All seems fine so far.

I uninstalled sqlite3-ruby and reinstalled it, and I'm still getting the initial error:

SQLite3::SQLException: near "DISTINCT": syntax error: SELECT count(DISTINCT customers.id) AS count_all FROM customers  LEFT OUTER JOIN catalog_hosts ON catalog_hosts.id = customers.catalog_host_id  LEFT OUTER JOIN locations ON locations.customer_id = customers.id  LEFT OUTER JOIN users ON users.customer_id = customers.id

But if I run sqlite3 in Terminal and run this same command, it works.  So it appears to be a problem with the sqlite3-ruby gem and which development lib it's using when it gets compiled.  In an attempt to remedy that, I instealled sqlite3-dev via fink and uninstalled/reinstalled sqlite3-ruby again, to no avail.  I did notice in the output that it might be using /usr/local/include, so I made a symlink /usr/local/include/sqlite3.h -> /sw/include/sqlite3.h, but that didn't help either.

I'm out of ideas and am in great need of help.

Peace,
Phillip

Re: SQLite3 version problem

I had the same issue FWIW. I fixed it by installing the latest sqlite3 from source (3.5.1) and 'sudo gem update sqlite3-ruby'.