#277 ✓resolved
Alex Coles

do_mysql fails to compile on OSX

Reported by Alex Coles | May 12th, 2008 @ 03:05 PM

Experiencing the following issue when trying to build do_mysql:


My version of MySQL is as follows:

mysql  Ver 14.12 Distrib 5.0.45, for apple-darwin9.0.0 (i686) using  EditLine wrapper

I had previously experienced a similar error, which was solved by making sure the mysql/bin was in my $PATH.

I have tried installing with various options:

sudo gem install pkg/do_mysql-0.9.0.gem  -- --with-mysql-dir=/usr/local/mysql
sudo env ARCHFLAGS="-arch i386" rake compile -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

but to no avail.

Comments and changes to this ticket

  • Luis Lavena

    Luis Lavena May 14th, 2008 @ 09:35 PM

    From the pastie:

    ... -arch i386 -arch x86_64 -arch ppc7400 -arch ppc64 
    ... have the same architectures (ppc7400) and can't be in the same fat output file

    It seems ruby is trying to create a universal binary when the mysql binaries are not universal?

    Can you confirm if the mysql installation is universal or just i686?

  • Alex Coles

    Alex Coles May 15th, 2008 @ 12:38 PM

    • Title changed from “DO_mysql fails to compile on OS” to “do_mysql fails to compile on OS”

    The MySQL binaries I built are NOT universal.

    In fact, if I remember correctly, I followed the recipe over here: http://hivelogic.com/articles/20...

    As an update, I managed to get it installed with the following:

    sudo env ARCHFLAGS="-arch i386" rake install

    However, it fails with the previous error, if I just try to perform a compile:

    sudo env ARCHFLAGS="-arch i386" rake compile
  • Luis Lavena

    Luis Lavena May 16th, 2008 @ 01:38 AM

    • Title changed from “do_mysql fails to compile on OS” to “do_mysql fails to compile on OSX”


    mkmf (called from extconf) is trying to use the flags used to build Ruby to build also the extension.


    Ruby: fat (universal)

    MySQL: i386 (no universal)

    do_mysql: fat (due mkmf params).

    I can't reproduce that (since I don't have a mac) but I can bet is a recipe for failure.

    Did you manually installed Ruby (bya macports or compiled by hand) instead of the one supplied by Apple?

  • Alex Coles

    Alex Coles May 16th, 2008 @ 03:07 AM

    Ruby is the version bundled with OS X (1.8.6 patch 111), and is a UB:

    /usr/bin/ruby: Mach-O universal binary with 2 architectures
    /usr/bin/ruby (for architecture ppc7400):	Mach-O executable ppc
    /usr/bin/ruby (for architecture i386):	Mach-O executable i386

    My MySQL is i386, as you said.

  • Bernerd Schaefer

    Bernerd Schaefer June 9th, 2008 @ 12:38 PM

    • State changed from “new” to “hold”

    It seems that this is no longer an issue, is this correct? I'll place this on hold for now.

  • Dan Kubb (dkubb)

    Dan Kubb (dkubb) November 29th, 2008 @ 09:19 PM

    • Tag set to bug, build, c, dataobjects
    • Assigned user cleared.

    Alex, can you comment on whether or not this ticket is still valid? If not, I would like to mark it as resolved.

  • Dirkjan Bussink

    Dirkjan Bussink November 30th, 2008 @ 02:17 PM

    • State changed from “hold” to “resolved”
  • Dan Kubb (dkubb)

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

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

People watching this ticket