03
Feb

Rails, SQLite3 and OS X

While working my way through Agile Web Development with Rails (yes I’m learning Rails and Ruby, more on this too later) I ran into the following error:

SQLite3::SQLException: near “ADD”: syntax error: ALTER TABLE products ADD “date_available” datetime

while trying to add a column through a migration. Searching Google took me to a couple of places, but it took a while to find a result that explained how to resolve this issue.

Luckily I came across this post by Mark Cornick, which explained that the issues was caused by the version of SQLite3 that is included in OS X 10.4.

After downloading and installing (from source) the latest version of SQLite3, and uninstalling and reinstalling the sqlite3-ruby gem

sudo gem uninstall sqlite3-ruby
sudo gem install sqlite3-ruby

I was able to run the migration to add the column and continue on.

4 Comments so far

Leave a comment

Name(required)
Mail (will not be published)(required)
Website

Fields in bold are required. Email addresses are never published or distributed.

Some HTML code is allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
URLs must be fully qualified (eg: http://blogs.sackheads.org/hide),and all tags must be properly closed.

Line breaks and paragraphs are automatically converted.

Please keep comments relevant. Off-topic, offensive or inappropriate comments may be edited or removed.

    About

    Search

    Tag Cloud