What are the pitfalls and solutions when setting up Rails/Mysql on Leopard?

て烟熏妆下的殇ゞ 提交于 2020-01-16 14:44:10

问题


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/



来源:https://stackoverflow.com/questions/1206143/what-are-the-pitfalls-and-solutions-when-setting-up-rails-mysql-on-leopard

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!