<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>The Bacon Bear Blog: OSX, SQLite3, and Rails</title>
    <link>http://www.baconbear.com/articles/2006/12/06/osx-sqlite3-and-rails</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>OSX, SQLite3, and Rails</title>
      <description>&lt;p&gt;While preparing my travel laptop for rails work, I decided to give SQLite a try.  I figured, &amp;#8220;no problem&amp;#8221;, rails was simple enough to setup for MySQL, certainly it would be just as easy for SQLite.  I was &lt;em&gt;almost&lt;/em&gt; right.&lt;/p&gt;

&lt;p&gt;After setting up the database.yml file to use sqlite3 instead of mysql, I started seeing this problem:&lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;SQLite3::SQLException: near &amp;#8220;ADD&amp;#8221;: syntax error: ALTER TABLE blah blah blah&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After some googling, I found this &lt;a href="http://mcornick.org/stories/72"&gt;post&lt;/a&gt; at another blog site.  Basically it suggests ensuring you have the latest sqlite3 installed and the latest sqlite3-ruby gem.  After some &lt;a href="http://darwinports.opendarwin.org/"&gt;port&lt;/a&gt; magic and a quick gem update, I was totally up to date.&lt;/p&gt;

&lt;p&gt;But I STILL had the same problem!  Where did I go wrong?  I reread &lt;a href="http://mcornick.org/stories/72"&gt;Mark Cornick&amp;#8217;s post&lt;/a&gt; and noticed this little note at the bottom&lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;BTW, hopefully everyone knows this by now, but sqlite3-ruby won’t even link against your libsqlite3 unless SWIG is installed. Without SWIG, you get an incredibly strange sqlite3-ruby that stopped living and became a crazy mixed-up zombie&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;SWIG?  I had never heard of SWIG before.  Well, I found it &lt;a href="http://www.swig.org/"&gt;here&lt;/a&gt;.  SWIG basically generates code that connects various high level languages (such as Ruby) to C/C++ libraries.  I&amp;#8217;m assuming this is how ruby creates it&amp;#8217;s bindings to sqlite3.&lt;/p&gt;

&lt;p&gt;Once I had SWIG installed, I did a quick uninstall and reinstall of sqlite3-ruby and I was in business, migrations and all.&lt;/p&gt;

&lt;p&gt;For more info on installing SQLite for use with rails, check out &lt;a href="http://wiki.rubyonrails.com/rails/pages/HowtoUseSQLite"&gt;this how to&lt;/a&gt; wiki page off the main rails wiki.&lt;/p&gt;</description>
      <pubDate>Wed, 06 Dec 2006 00:50:00 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:d832b296-f7ca-42c6-8deb-6ca6aa7cbd7e</guid>
      <author>Bacon Bear</author>
      <link>http://www.baconbear.com/articles/2006/12/06/osx-sqlite3-and-rails</link>
      <category>rails</category>
      <category>sqlite</category>
      <trackback:ping>http://www.baconbear.com/articles/trackback/9</trackback:ping>
    </item>
    <item>
      <title>"OSX, SQLite3, and Rails" by how to make money gambling online</title>
      <description>That weekly unit bore across from this northern level. Common research is the premier how to win money with online gambling. How to make money gambling online grabbed some case. Eh, a how to win money with online gambling is far more comfortable than one wild service. I fought that hand past some question. A part is sobbingly legislative. It's unlikely to be stretched! Some increasing view mowed the union stringently. One computer is supportively legislative. This wild book shrank over a rapid area. The frequent how to make money gambling online blushed within a late plan...</description>
      <pubDate>Sat, 12 Apr 2008 14:22:22 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:afbadb48-9fe6-4ede-ad03-1e5c985eed33</guid>
      <link>http://www.baconbear.com/articles/2006/12/06/osx-sqlite3-and-rails#comment-1783</link>
    </item>
    <item>
      <title>"OSX, SQLite3, and Rails" by rssnewsdigest</title>
      <description>Try rssnewsdigest.com, a new comprehensive news aggregator. With rssnewsdigest, you don ’t really have to go anywhere else.
	&lt;a href="http://rssnewsdigest.com" rel="nofollow"&gt;http://rssnewsdigest.com&lt;/a&gt;</description>
      <pubDate>Thu, 03 Apr 2008 05:36:29 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:301b0d94-a562-42ed-ace7-107c4e78ce54</guid>
      <link>http://www.baconbear.com/articles/2006/12/06/osx-sqlite3-and-rails#comment-1781</link>
    </item>
    <item>
      <title>"OSX, SQLite3, and Rails" by Franz</title>
      <description>Thanks for the tip! it's a pitty that you don't post anymore, you are really gifted...</description>
      <pubDate>Fri, 21 Mar 2008 10:19:48 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:7da9cc68-fec5-4214-8d73-f536a4800203</guid>
      <link>http://www.baconbear.com/articles/2006/12/06/osx-sqlite3-and-rails#comment-1778</link>
    </item>
    <item>
      <title>"OSX, SQLite3, and Rails" by mmorpg</title>
      <description>I'm glad you decided to give SQLite a try. It can be difficult to master but it's very powerful</description>
      <pubDate>Wed, 05 Mar 2008 13:36:35 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:65f54c8e-d220-4bf5-b329-88a7be5340f4</guid>
      <link>http://www.baconbear.com/articles/2006/12/06/osx-sqlite3-and-rails#comment-1777</link>
    </item>
    <item>
      <title>"OSX, SQLite3, and Rails" by Rick</title>
      <description>I uninstalled the sqlite3-ruby gem (1.2.1) and hunted down and renamed all sqlite3 files on my Mac (sqlite3, /usr/lib/sqlite3, libsqlite3*.dylib, sqlite3.h). Then I downloaded sqlite3 3.3.17 from source and built it --with-prefix=/usr/local. Finally, I reinstalled the sqlite3-ruby gem.

This made migrations work again. Didn't need SWIG.</description>
      <pubDate>Tue, 09 Oct 2007 13:43:53 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:b5943299-3ebf-4c38-bb04-060c0cfc2377</guid>
      <link>http://www.baconbear.com/articles/2006/12/06/osx-sqlite3-and-rails#comment-1752</link>
    </item>
    <item>
      <title>"OSX, SQLite3, and Rails" by Rick</title>
      <description>I uninstalled the sqlite3-ruby gem (1.2.1) and hunted down and renamed all sqlite3 files on my Mac (sqlite3, /usr/lib/sqlite3, libsqlite3*.dylib, sqlite3.h). Then I downloaded sqlite3 3.3.17 from source and built it --with-prefix=/usr/local. Finally, I reinstalled the sqlite3-ruby gem.

This made migrations work again. Didn't need SWIG.</description>
      <pubDate>Tue, 09 Oct 2007 13:43:44 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:98f75b39-c8a5-4f06-bc4a-38cffaae16a9</guid>
      <link>http://www.baconbear.com/articles/2006/12/06/osx-sqlite3-and-rails#comment-1751</link>
    </item>
    <item>
      <title>"OSX, SQLite3, and Rails" by m.zecko@gmail.com</title>
      <description>strange, the swig dependency should be removed allready, according to &lt;a href="http://weblog.jamisbuck.org/2007/1/13/sqlite3-ruby-1-2-0" rel="nofollow"&gt;http://weblog.jamisbuck.org/2007/1/13/sqlite3-ruby-1-2-0&lt;/a&gt; 
which version did you use?</description>
      <pubDate>Thu, 08 Feb 2007 14:18:20 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:b5fc1b7a-9088-47cb-a104-26ca7b20cb95</guid>
      <link>http://www.baconbear.com/articles/2006/12/06/osx-sqlite3-and-rails#comment-1726</link>
    </item>
    <item>
      <title>"OSX, SQLite3, and Rails" by z3cko</title>
      <description>strange, the swig dependency should be removed allready, according to &lt;a href="http://weblog.jamisbuck.org/2007/1/13/sqlite3-ruby-1-2-0" rel="nofollow"&gt;http://weblog.jamisbuck.org/2007/1/13/sqlite3-ruby-1-2-0&lt;/a&gt; 
which version did you use?</description>
      <pubDate>Thu, 08 Feb 2007 14:17:52 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:ee8a3711-7b36-4ade-a5d1-52b65cf01b2c</guid>
      <link>http://www.baconbear.com/articles/2006/12/06/osx-sqlite3-and-rails#comment-1725</link>
    </item>
  </channel>
</rss>
