0

I have just upgraded my macbook from mac os 10.5 to 10.6 and have spent all day trying to get the Ruby mysql gem to work on mac os 10.6 without any luck.

I am having exactly the same error messages as this guy: http://www.ruby-forum.com/topic/1112530

It seems that all I need to do is install 64 bit mysql instead of the 32 bit one but for some retarted reason this is proving to be impossible.

I have downloaded two versions of the 64 binary installer from mysql.com:

mysql-5.1.61-osx10.6-x86_64.dmg 
mysql-5.5.21-osx10.6-x86_64.dmg

No matter which one I install when I install when I lookup

mysql> SHOW GLOBAL VARIABLES LIKE 'version_compile_machine';

then it returns:

version_compile_machine | i386

Which seems to mean that its running 32 bit. However if I look at the mysqld process in the activity monitor then it seems to suggest that its actually running in 64 bit mode which leaves me completely confused?! enter image description here

Does anyone know how to fix this? Pleeease help, im losing it..

I have Mac OS 10.6.3
Processor 2.4 GHz Intel Core 2 Duo
Darwin Kernel Version 10.3.0: Fri Feb 26 11:57:13 PST 2010; root:xnu-1504.3.12~1/RELEASE_X86_64 x86_64
Nick
  • 2,715
  • 4
  • 24
  • 35
  • Did you try setting `export ARCHFLAGS="-arch x86_64"` before compiling the mysql2 gem? – iltempo Feb 29 '12 at 06:24
  • yes indeed, I have followed all the advice on http://stackoverflow.com/questions/991708/rails-mysql-and-snow-leopard but to no avail. – Nick Feb 29 '12 at 06:34

1 Answers1

0

Finally found the answer so going to leave it here to hopefully save other people a bit of trouble.

By default, rvm was not building the x86_64 version of Ruby (was defaulting to i386). To fix this, I added the following to ~/.rmvrc:

rvm_archflags="-arch x86_64"

Then, I removed the current versions of ruby using rvm and reinstalled ruby version 1.9.2 using rvm. After all that, the MySQL gem installed w/o a hitch.

Nick
  • 2,715
  • 4
  • 24
  • 35
  • Regarding the version_compile_machine returning i386, this is a bug in MySQL for Mac OSX in versions < 5.6.8. See http://bugs.mysql.com/bug.php?id=67024 – markjan Nov 23 '12 at 19:19