繁体   English   中英

使用MAMP for Ruby设置MySQL

[英]set up MySQL with MAMP for Ruby

我正在尝试将Ruby与MAMP附带的MySQL一起使用,但是没有安装标头(或类似的东西)存在问题。

有人向我介绍了下面复制的教程,但我无法使它正常工作。 当我在第一行中输入./configure ...时,它说没有这样的目录。

1)一个特别的问题是,“ copy the MySQL source file (mysql-5.1.37.tar.gz) to somewhere on your hard drive. ”我不知道是否通过安装MAMP来完成此操作步或不步。 如果没有,那我不知道该怎么办。

2)当源文件“ cd”和“ cd”“未知”时,我也不知道这是什么意思……如果安装了MAMP,是否已经将其解压缩?

3)另外,我只是打开终端并启动此代码,还是必须进入Mysql?

我想知道是否有人可以告诉我如何适应它。 这是有关安装的其他2条信息,可能会有所帮助。

一种)。 我的计算机上的端口8889上设置了MySQL。 b)同样,当我在命令行中输入“哪个mysql”时,它也会以“ / usr / local / mysql / bin / mysql”响应。

如果可以的话请帮忙。 谢谢。

Download the latest MAMP dmg file.
Download the 1.8.2 (or whichever the latest one you could find) components file from this page.
Unzip, mount the dmg, then copy the MySQL source file (mysql-5.1.37.tar.gz) to somewhere on your hard drive.
Untar the MySQL source file, and `cd` to the source file directory.
Compile the library:

$ ./configure --with-unix-socket-path=/Applications/MAMP/tmp/mysql/mysql.sock --without-server --prefix=/Applications/MAMP/Library

$ make -j2

Copy the compiled libraries into MAMP:
$ cp libmysql/.libs/*.dylib /Applications/MAMP/Library/lib/mysql

Copy the MYSQL headers into MAMP:

$ mkdir /Applications/MAMP/Library/include

$ cp -R include /Applications/MAMP/Library/include/mysql

Install the Ruby MySQL Gem, on Snow Leopard:

$ sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/Applications/MAMP/Library/bin/mysql_config

On Leopard:


$ sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/Applications/MAMP/Library/bin/mysql_config

Enjoy!

EDIT @ 2009-11-23: If you’re still experiencing problems (perhaps with RVM), try adding “/Applications/MAMP/Library/bin/” to your $PATH in “~/.bash_profile”.

您可能应该遵循此链接中的教程。 它已使用mysql2为MAMP 1.9.5更新。 新的MAMP版本进行了几处更改。

http://blog.mirotin.net/?p=35

此外,您可以在此链接中找到所需的tar文件。 下载MAMP_components_1.9.5.dmg文件。

http://sourceforge.net/projects/mamp/files/mamp/1.9.5/

最终通过这篇博客文章解决了这个问题: http : //newfangled.me/installing-mamp-and-rails-on-a-mac/

这是该文件离线时的存档版本http://web.archive.org/web/20130728130916/http://newfangled.me/installing-mamp-and-rails-on-a-mac

另一个答案对我来说是404s。 http://blog.mirotin.net/?p=35我本人一直在为此苦苦挣扎。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM