Posts filed under "OSX"

The Inevitable MySQL Gem Install

Got your new box all set up? Let's do some Rails:

$ rake db:create
!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please 
install the mysql gem and try again: gem install mysql.

rake aborted!
no such file to load -- mysql

If you're on Ubuntu, do this:

$ sudo apt-get install libmysqlclient15-dev 
$ which mysql_config
/usr/bin/mysql_config

$ sudo gem install mysql -- --with-mysql-config=/usr/bin/mysql_config
Building native extensions.  This could take a while...
Successfully installed mysql-2.7
1 gem installed

If you're running on OSX and have installed mysql from MacPorts, mysql_config is already installed:

$ sudo gem install mysql -- --with-mysql-config=/opt/local/bin/mysql_config5

Done.

Dot-Underscore Hell

A frustrating situation courtesy of OSX and mounted drives (over SMB in this case):

linux-host$ svn status
?      site/actions/._contact.php
M      site/actions/contact.php
?      site/conf/._controller-config.ini
?      site/conf/._nav-config.php
M      site/conf/nav-config.php
?      site/templates/._contact.php
M      site/templates/contact.php

Luckily, there's a command for that (OSX Leopard):

mac$ dot_clean .
linux-host$ svn status
M      site/actions/contact.php
M      site/conf/nav-config.php
M      site/templates/contact.php

See man dot_clean for more information. Credit to MacWorld for this tip.

Update: Since posting this, Brian pointed out that this is most likely a setting inside of TextMate. To disable, just run this command from a terminal:

defaults write com.macromates.textmate OakDocumentDisableFSMetaData 1

Do not run this using sudo if you want it to work (I found out the hard way).