This project is archived and is in readonly mode.

#2385 ✓invalid
Joseph Palermo

Change instructions for installing mysql ruby bindings.

Reported by Joseph Palermo | March 31st, 2009 @ 06:05 PM | in 2.x

If you don't have the mysql ruby bindings installed, you get the following error:

!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.

The problem with telling people to install the gem, is that the latest version of the gem is old (2.7.0) and known to leak memory:

version 2.7.4

* BUG: Mysql::Stmt#execute memory leak.

This patch would change the message to the following:

!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the ruby mysql bindings from http://www.tmtm.org/en/mysql/ruby/ and try again.

Somebody will probably suggest creating an updated gem, but installing bindings from a gem is a really bad idea anyway. -It gives you the impression that you can have multiple versions of the binding, which is probably not the case, installing one will overwrite the existing binding, but it will still look like you have both gems installed. -It gives you the impression that you can remove the binding by uninstalling the gem, I'm not sure if this is actually possible or not, but I know the current version of the mysql gem does NOT work this way.

Comments and changes to this ticket

  • Chad Woolley

    Chad Woolley March 31st, 2009 @ 06:18 PM

    +1 for changing the message to not point to the bad gem.

  • Zach Brock
  • Roland Moriz

    Roland Moriz April 11th, 2010 @ 02:30 AM

    So in the meantime the gem was updated on rubygems and looks to be maintained again.

    I think this issue is resolved now:

    Users without any mysql extension installed need an easy to follow instruction how to install mysql support:
    This happens only when no mysql gem is available, right? So there's no version missmatch.

    I really don't see your "can have only one binding installed at the same time" issue here.
    Sure, it's a limitation but it's not relevant when the message is shown because no mysql extension is installed at all?

    Or am I wrong?

    Besides that: What if the tmtm.org site goes down? It's a single point of failiure and a maintenance mess to care about external URLs imho.

    -1

  • Joseph Palermo

    Joseph Palermo April 11th, 2010 @ 03:03 AM

    Yes, the fact there there is a good very of the gem mostly resolves this issue.

    Using gems to install binary bindings is still not a good idea because even though you are requiring one version of the gem, you may actually be getting another. This could be a very bad thing in a shared environment (you could end up using a bad version of the library even though you are requiring the correct one). This is somewhat mitigated by the fact that the mysql gem isn't updated very often.

    Everybody else seems to be ok with installing binary libraries through gems, so I'm willing to throw up my arms on this one. Telling users to use the gem is certainly the easiest thing for them, even though it may not be the correct thing. Explaining the issue to new users would be nice, but it would probably just confuse most of them.

    I guess the ideal solution would be to fix the mysql gem such that it does a check on activation to make sure the required gem version matches the library version that actually got loaded and throw an error if they do not match.

  • Ryan Bigg

    Ryan Bigg April 11th, 2010 @ 03:04 AM

    • State changed from “new” to “invalid”

    No longer applicable, the mysql gem works for all purposes I have seen.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Tags

Pages