Mysql gem: version specification and update problem

The mysql gem has unfortunate interaction between gem versions,
platforms, and updating on macosx. I’m trying to figure out if it is
a problem with rubygems or the specification for the mysql gem itself.

The latest version of the mysql gem for the mac is v2.7 while the
latest version is 2.7.3.

$ gem list mysql -r

*** REMOTE GEMS ***

mysql (2.7.3, 2.7.1, 2.7, 2.6, 2.5.1)
mysql_replication_adapter (0.4.0, 0.2.0, 0.1.1, 0.1.0)
mysql_retry_lost_connection (0.0.1)

After I install the mysql gem on my mac any future use of the command:

sudo gem update

assumes the mysql gem is not up-to-date and tries to re-install it.

Previously I would just be presented with a console request asking if
I wanted to update the mysql gem – there was actually no update for
the mac and I would just answer no.

Now because dependencies are automatically followed it is always
getting rebuilt.

This would just be a waste of bandwidth and processing except that
successfully compiling the mysql gem on macosx requires setting an
env variable … so everytime I update all my gems the mysql gem
rebuild of it’s native libraries fails.

I’m finding this problem on: MacOS X 10.4.11, ruby 1.8.6p11, rubygems
v0.9.5

Is this a bug in rubygems or in how the mysql gem is specified?

---- example ----

$ sudo gem uninstall mysql
Successfully uninstalled mysql-2.7

$ sudo gem install mysql – --with-mysql-dir=/usr/local/mysql
Building native extensions. This could take a while…
Successfully installed mysql-2.7
1 gem installed

$ gem outdated

$ sudo gem update
Updating installed gems…
Attempting remote update of mysql
Building native extensions. This could take a while…
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.

/usr/local/bin/ruby extconf.rb update
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

Gem files will remain installed in
/usr/local/lib/ruby/gems/1.8/gems/mysql-2.7 for inspection.
Results logged to
/usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/gem_make.out
Gems: [mysql] updated

On Dec 11, 2007, at 07:45 AM, Stephen B. wrote:

The mysql gem has unfortunate interaction between gem versions,
platforms, and updating on macosx. I’m trying to figure out if it is
a problem with rubygems or the specification for the mysql gem itself.

The correct place to report a bug on RubyGems is on the tracker.

On Dec 11, 2007, at 07:45 AM, Stephen B. wrote:

The mysql gem has unfortunate interaction between gem versions, platforms, and updating on macosx. I’m trying to figure out if it is a problem with rubygems or the specification for the mysql gem itself.

The correct place to report a bug on RubyGems is on the tracker.

Thanks for responding Eric,

I didn’t know if it was a problem in rubygems or in the gem
specification for the mysql gem. You didn’t explicitly answer that
question but I’ll assume you think it’s likely a bug in rubgems.

Here’s a link to the bug report in the rubyforge tracker for rubygems.

http://rubyforge.org/tracker/index.php?func=detail&aid=16244&group_id=126&atid=575