What are the pitfalls and solutions when setting u

2019-08-16 15:19发布

问题:

I've been going stir crazy trying to install the ruby mysql gem here, and I'm writing here so if anyone else is in this ridiculous situation, they don't have to go through the same pain as me.

What are the common gotchas when installing the mysql gem onto a fresh copy of Leopard?

In this case, I'm using

Leopard - OS 10.5.7 The stock version of Ruby - 1.8.6 Rubygems 1.3.5 The 32bit version of 5.1.36 Mysql, installed using the GUI installer.

I've dumped all the relevant config info here for my machine as a starter:

http://gist.github.com/158662

What info helps here, and what would I need to do?

I'm explicitly calling the i386 archiecture for the build, and tellign with where mysql is:

sudo env ARCHFLAGS="-arch i386" gem install mysql -- \
    --with-mysql-dir=/usr/local/mysql \
    --with-mysql-lib=/usr/local/mysql/lib \
    --with-mysql-include=/usr/local/mysql/include

I've tried following instructions here, here, and here

回答1:

The ruby mysql gem doesn't like the 64-bit version on Leopard. If you can, downgrade.

Then you should call the sudo gem install mysql with the options (change it to your path):

--with-mysql-dir=/usr/local/mysql 
--with-mysql-lib=/usr/local/mysql/lib 
--with-mysql-include=/usr/local/mysql/include

Worked for me. (The blog post which help me is in German, might help you anyway.)

http://www.code-schubser.de/2008/12/05/mysql-gem-unter-macosx-leopard-installieren/



标签: mysql ruby gem