[Noisebridge-discuss] Rails/mysql/gem on Snow Leopard help?

Robert Fletcher lobatifricha at gmail.com
Sun Apr 24 04:35:45 UTC 2011


Yeah, dealing with the dependencies on MacOS can be a bit of a nightmare.  I
ran into similar issues when I was developing on it for a while and I can't
remember the exact solution, but here's something to try.  First you need to
remove all traces of MySQL from your system.  This is assuming you don't
already have valuable data in your database, in which case you're on your
own figuring out how to deal with that.  Remove the ruby mysql gem:

sudo gem uninstall mysql

You may want to double check that the gem is completely gone.  If it has
compiled improperly it can interfere with further attempts to reinstall it.
Remove any MySQL folder you find in your gem path, usually
/usr/bin/ruby/gems/1.8/gems/

Then remove all mysql related stuff:

sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm /etc/my.cnf

Now start over.  Reinstall MySQL.  I think my problems may have stemmed from
the version of MySQL I was using at the time.  Rather than the latest
version (5.5.11) now I'm working with 5.1.56 which works fine.  You can find
it if you go to the MySQL download page and click on the previous versions
link:

http://www.mysql.com/downloads/mysql/5.1.html#downloads

There were some other issues, I think with installing the gem on 64-bit
MacOS.   You can try installing it regular with:

sudo gem install mysql

But if you run into issues you may need to try:

sudo env ARCHFLAGS="-arch x86_64" gem install mysql

Some combination of the above should help solve your problem.  All comes
with the usual disclaimer:  If your computer gets discombobulated it's not
my fault.  If it isn't critical to use MySQL on your local machine I would
actually recommend sticking with the default SQLite for development and then
worry about switching in MySQL or Postgres when you put it into production.
(Heroku takes a lot of the stress out of it by handling the whole mess for
you--you just have to be okay with some downtime if Amazon takes a dive.)

Good luck!
- Robert

On Sat, Apr 23, 2011 at 5:10 PM, Rachel McConnell <rachel at xtreme.com> wrote:

> I'm getting an error when I try to run a rake db:[whatever] task:
>
> uninitialized constant MysqlCompat::MysqlRes
>
> I've googled extensively and tried all the fixes suggested, none of
> which have worked.  I am pretty sure there is an incompatibility in the
> mysql gem, but have no idea how to find or solve it.
>
> Is anyone here a super Rails/Ruby on Mac ninja who has interest in going
> through it with me and helping me figure it out?  I can write out the
> details in email if anyone wants to try their hand at it that way.
>
> Rachel
>
>
>
> _______________________________________________
> Noisebridge-discuss mailing list
> Noisebridge-discuss at lists.noisebridge.net
> https://www.noisebridge.net/mailman/listinfo/noisebridge-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.noisebridge.net/pipermail/noisebridge-discuss/attachments/20110423/809645ff/attachment-0003.html>


More information about the Noisebridge-discuss mailing list