Installing sqlite3-ruby gem on Snow Leopard

Problem:

After upgrading to Snow Leopard, I had to rebuild/reinstall MacPorts and RubyGems as recommended. While doing this, I found that sqlite3-ruby gem install failed with errors related to extconf.rb file.

Solution:

Not sure why this works but I found a working solution at StackOverflow which replaces:

/usr/local/lib/libsqlite3.dylib

with a symbolic link to one that came with XCode for Snow Leopard:

/Developer/SDKs/MacOSX10.6.sdk/usr/lib/libsqlite3.0.dylib

You can find the full ‘ln’ command at StackOverlow page above but be sure to rename the original in case you need to restore it.

Merb Herbs

Just a couple of crumbs from my brush with Merb tonight:

dependencies.rb

After merb-gen app, edit config/dependencies.rb to fix version numbers of dm_gems_version and do_gems_version gems used by the generated app. To find out what which version you have, type

gem list {gem-name}.

Missing some MySQL dylib on OS X

When I got some errors like “dyld: NSLinkModule() error “, probably after doing sudo gem install do_mysql for reasons I can’t recall, I fixed it with this:

sudo mkdir /usr/local/mysql/lib/mysql
cd /usr/local/mysql/lib/mysql
sudo ln -s /usr/local/mysql/lib/*.dylib .

I’ll add to this post over time as more crumbs fall. Note that I am not a Merb, Rails, nor Ruby guy. I am not a guru in anything but everything which means exactly nothing. Yes, I am trying to confuse you. ;-p