Anil's Doublespeak

Facebook Profile

Choosing your profile picture (from PhD Comics – extras included)

Original comic here.


Posted by Anil on May 11th, 2008 :: Filed under Uncategorized

Ruby on Rails and mysql connection problems

If you are losing connection to mysql every so often on OSX (I’m using 10.5 Leopard), it’s probably because you do not have the native C ruby-mysql bindings. If your error looks like this:

Mysql::Error: Lost connection to MySQL server during query:

then try the following. Verify that the bindings are really not present. In a terminal window, open up the interactive ruby shell and type the following commands:

irb
>> require ‘mysql.bundle’
=> true
>> exit

If you do not get ‘true’, then you need the bindings. Back to your terminal window and type the following:

$ sudo -s
$ ARCHFLAGS=”-arch i386″ gem install mysql — –with-mysql-dir=/usr/local/mysql

Try require ‘mysql.bundle’ again and this time you should get back true.

Sources: 1 and 2.


Posted by Anil on May 10th, 2008 :: Filed under Uncategorized

Grounds for your garden

Did you know that you can get coffee grounds for free from any Starbucks? Just walk in and ask for ‘Grounds for your Garden’ and you will receive a huge bag of used coffee grounds that you can use to dress up your soil. If you live in Arizona, you probably need some acidity in your soil anyway, so try it out!


Posted by Anil on May 4th, 2008 :: Filed under Uncategorized