DarwinPorts, MySQL5, and Ruby C bindings
If you’ve ever tried to install Ruby, Ruby On Rails, MySQL 5, and the Ruby C bindings via DarwinPorts on Mac OS X, you might find yourself running into a weird error. Or three. My particular problem was that the Ruby gem for the MySQL bindings couldn’t find the MySQL5 header files or libraries, and as such the gem would never compile. DarwinPorts uses its own weird little placement for the files, and as such it took me a few minutes to figure out how to get it to build. So, assuming you have a default install of DarwinPorts and have gone through the trouble of installing Ruby and Ruby gems, just do a
gem install mysql — –with-mysql-lib=/opt/local/lib/mysql5/mysql/ –with-mysql-include=/opt/local/include/mysql5/mysql/
and everything should work swimmingly.




