So I'm trying to get a Rails stack working on my new MacBook Pro... without much success. I thought I'd do the cool thing and install the 64-bit MySql (since I do have a 64-bit chip, ya know) but I've run into the same problems as others.
I've read these (found via Google):
I've tried tips from the comments:
- building various ways including ARCHFLAGS where arch is i368, x86_64, etc
- removing /Library/Ruby/Site/1.8/universal-darwin9.0/mysql.bundle
No matter what I do I'm left with one of the following problems (i386 arch):
dyld: lazy symbol binding failed: Symbol not found: _mysql_init
Referenced from: /Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle
Expected in: dynamic lookup
or this (x86_64 arch:)
dlopen(/Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle, 9): no suitable image found. Did find:
/Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle: mach-o, but wrong architecture - /Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle
Several people said they found the solution, but nothing I've tried has worked. Does anyone have a better solution to this problem than downgrading back to the 32-bit version of MySql? I wonder if I built Ruby from ports if that would fix it.
Any suggestions? When I get THE answer (if there is one) I'll update this post.
UPDATE: One REAL solution posted here.
The trouble here (as far as I understand) is ruby is 32-bit, so it can't link against the 64 bit libraries.
The closest thing to a solution that I've come up with is to build the mysql gem against 32 bit drivers, and then copy them over to the new machine, along with the supporting lib files in /usr/local/mysql/lib
Here's the prebuilt mysql gem:
http://www.mediafire.com/?kynzm0ntnqm
You'll need the files from the 32-bit mysql 5.0 client library files. Put them in /usr/local/mysql/lib
This way, you can run the 64 bit server, but still use the 32 bit ruby gem.
Hope that helps
Posted by: Timothy Harper | October 20, 2008 at 12:31 PM
Would that not have the side effect of hosing my local MySQL binaries since they will have been linked against the 64-bit libs that are expected to be in /usr/local/mysql/lib?
Posted by: Josh Goebel | October 21, 2008 at 04:51 AM