Lost mySQL connections on OS X, in development mode, with ruby adapter

I just posted a new but likely old bug to the trac, at:


In short, the ruby mysql bindings try to send /1 characters to closed
connections, causing AR to bail on a call to Finalizer at random places
during execution.

I don't know if this is a blocker, but after 3-4 people on my team have
had the same problem at different points over the past months and been
forced to patch the adapter to force it to discard raised errors, it
sure could be.

Also, installing the mysql gem seems to fix the problem. I'm one of the
lucky ones that can't get that gem to compile for reasons unclear.



My team has also encountered such issues.

As far as compiling the mysql gem is concerned, are you using OSX?

If so, you'll need to do the following:

manually download the mysql-ruby gem,
extract and move to the extracted directory then run:
> ruby extconf.rb --with-mysql-dir=/usr/local/mysql
Once that finishes, there should be a mysql.c in the directory,
add the following line as line 48 (yes you include the '#')

#define ulong unsigned long

Then continue as normal:
make -j4
sudo make install



Or just make if you don't have 5 processors (:


::cough:: err... whoops... (*only* a dual core unfortunately :wink: )

Good point, for multi-core or multi processor the use of -j4 with make is optional but *may* speed up compile time.