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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | Error:cdERROR: Error installing mysql:ERROR: Failed to build gem native extension./usr/local/bin/ruby extconf.rb --with-mysql-dir=/opt/local/binchecking for mysql_query() in -lmysqlclient... nochecking for main() in -lm... yeschecking for mysql_query() in -lmysqlclient... nochecking for main() in -lz... yeschecking for mysql_query() in -lmysqlclient... nochecking for main() in -lsocket... nochecking for mysql_query() in -lmysqlclient... nochecking for main() in -lnsl... nochecking for mysql_query() in -lmysqlclient... nochecking for main() in -lmygcc... nochecking for mysql_query() in -lmysqlclient... no*** extconf.rb failed ***Could not create Makefile due to some reason, probably lack ofnecessary libraries and/or headers. Check the mkmf.log file for moredetails. You may need configuration options. |
Command:
1 | sudo gem install --include-dependencies mysql -- --with-mysql-dir=/opt/local/bin --with-mysql-config=/opt/local/bin/mysql_config5 |