in Libraries

Ruby Hiccups

I decided to try out some Ruby stuff this weekend. I wanted to do a quick little game with the rubygame gem, but I got some weird error attempting to install it on my 64-bit Snow Leopard Intel Mac Powerbook. I abandoned the effort, since I hate to expend time in system administration and installation.

Next, I decided to try running through a Rails demo. I wanted to use MySQL instead of the default SQLite, but got an error, whose text is below, when I tried installing the mysql gem. I resolved it by using the command string that follows, which I found on a MySQL website forum post.  I think the main issue was that I had a non-standard installation of mysql on my machine via macports, so I had to specify the locations of the various MySQL directories in the gem install command.

Error:
cdERROR:  Error installing mysql:
ERROR: Failed to build gem native extension.

/usr/local/bin/ruby extconf.rb --with-mysql-dir=/opt/local/bin
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Command:

sudo gem install --include-dependencies mysql -- --with-mysql-dir=/opt/local/bin --with-mysql-config=/opt/local/bin/mysql_config5