Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
288 views
in Technique[技术] by (71.8m points)

sudo: port: command not found setting up Ruby with MySQL MAMP

I'm using a Mac 10.6.6, with MAMP installed. I am trying to get Ruby working. There is a problem with the headers, so I was referred to this tutorial. http://blog.mirotin.net/?p=35

I have MySQL 5.5. installed on my computer

When I type in the 5th line below $ sudo port install cmake, it says

sudo: port: command not found

Do you know what I can do about this?

$ cd /tmp
$ mv /Users/yourname/Desktop/mysql-5.5.9.tar.gz .
$ tar xf mysql-5.5.9.tar.gz
$ cd mysql-5.5.9
$ sudo port install cmake
$ cmake . -DMYSQL_UNIX_ADDR=/Applications/MAMP/tmp/mysql/mysql.sock -DCMAKE_INSTALL_PREFIX=/Applications/MAMP/Library
$ make -j 3
$ cp libmysql/*.dylib /Applications/MAMP/Library/lib/
$ mkdir -p /Applications/MAMP/Library/include/mysql
$ cp include/* /Applications/MAMP/Library/include/mysql
$ sudo env ARCHFLAGS="-arch x86_64" gem install mysql2 -- --with-mysql-config=/Applications/MAMP/Library/bin/mysql_config
$ sudo install_name_tool -change /tmp/mysql-5.5.9/libmysql/libmysqlclient.16.dylib /Applications/MAMP/Library/lib/libmysqlclient.16.dylib /opt/local/lib/ruby/gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle
$ rm -rf /tmp/mysql-5.5.9 /tmp/mysql-5.5.9.tar.gz
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It would me much better if you keep the posts in the same thread. Therefore we can help you more easily by reading the problem from the start.

port is an OS X package manager known is MacPorts. Therefore to get it to work you must first install MacPorts from http://www.macports.org/.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...