Using Ruby On Rails and the find method with conditions, it is also to possible to use the LIKE statement of SQL without having to escape variables or using raw SQL:

Read more…

If you are getting the following exception on a migration on Darwin / OS X:

SQLite3::SQLException: near "ADD": syntax error: ALTER TABLE "xxx" ADD "yyy" varchar(255)

then you can try the following:

  1. sudo gem uninstall sqlite3-ruby
  2. Install the latest sqlite3 from sources from sqlite.org
  3. sudo gem install sqlite3-ruby