「Mac」カテゴリーアーカイブ

MAMPの環境にrubyのMySQLアダプタをインストールする

MAMPの環境でgem install mysqlを実行すると、以下のエラーになる。

$ sudo gem install mysql
Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
	ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb install mysql
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... no
checking for mysql_query() in -lmysqlclient... no
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/mysql-2.7 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/mysql-2.7/gem_make.out

MAMPのmysqlは、ヘッダファイル、ライブラリがデフォルトの/usr/local/lib、/usr/local/includeにないので、オプションを指定する必要がある。オプションはいろいろあるが、--with-mysql-configを使うと便利。
MySQL/Ruby

--with-mysql-config[=/path/to/mysql_config]
    mysql_config コマンドの結果からコンパイルパラメータを得ます。 

mysql_config コマンドにパスが通るように、.bash_profileなどで、PATHにMAMPのディレクトリを追加しておくか、--with-mysql-config=/Applications/MAMP/Library/bin/mysql_configを指定する。
ここでは、PATHを設定します。

export PATH=/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php5/bin:/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin:$PATH

再度、インストール。

$ sudo gem install mysql -- --with-mysql-config
Building native extensions.  This could take a while...Successfully installed mysql-2.7
1 gem installed

OK。

TextMateを使ってみた

TextMate -- The Missing Editor for Mac OS X
TextMate - JotSpot Wiki (ytesaki)
TextMate stuff - hetima.com
日本語入力・表示プラグイン
[TxMt] How to add encodings to "Re-open with encoding" menu
任意のエンコードのファイルを読み込む方法
[TxMt] How to open an encoded file with TextMate?
任意のエンコードのファイルを読み込む方法...こっちはうまくいかなかった。
TextMate Manual Japanese Translation Project | Samurai Coder
TextMateマニュアル日本語訳プロジェクト
TextMate Manual
TextMateマニュアル日本語訳

続きを読む TextMateを使ってみた

MacPortsでMac OSX LeopardにTomcat5.5をインストールしてみた

MacPortsでMac OSX LeopardにTomcat5.5をインストールしてみたのでメモ。
最後に出力されるコメントに、起動方法、自動起動の設定方法、設定ファイルについての説明がある。
また、Tomcat AdministrationとTomcat Managerアプリケーションにログインするには、
$CATALINA_HOME/conf/tomcat-users.xmlにロールとユーザを追加する必要がある。

NOTE: For security reasons, using the administration webapp is restricted to users with role "admin". The manager webapp is restricted to users with role "manager". Users are defined in $CATALINA_HOME/conf/tomcat-users.xml.

$ sudo port install tomcat5
Password:
--->  Fetching junit
--->  Attempting to fetch junit3.8.1.zip from http://downloads.sourceforge.net/junit
--->  Verifying checksum(s) for junit
--->  Extracting junit
--->  Configuring junit
--->  Building junit with target dist
--->  Staging junit into destroot
--->  Installing junit 3.8.1_1
--->  Activating junit 3.8.1_1
--->  Cleaning junit
--->  Fetching commons-collections
--->  Attempting to fetch commons-collections-3.2-src.tar.gz from http://www.apache.org/dist/commons/collections/source/
--->  Verifying checksum(s) for commons-collections
--->  Extracting commons-collections
--->  Configuring commons-collections
--->  Building commons-collections with target jar javadoc
--->  Staging commons-collections into destroot
--->  Installing commons-collections 3.2_0
--->  Activating commons-collections 3.2_0
--->  Cleaning commons-collections
--->  Fetching apache-ant
--->  Attempting to fetch apache-ant-1.7.0-bin.tar.bz2 from http://www.apache.org/dist/ant/binaries
--->  Verifying checksum(s) for apache-ant
--->  Extracting apache-ant
--->  Configuring apache-ant
--->  Building apache-ant with target all
--->  Staging apache-ant into destroot
--->  Installing apache-ant 1.7.0_0
--->  Activating apache-ant 1.7.0_0
--->  Cleaning apache-ant
--->  Fetching jakarta-log4j
--->  Attempting to fetch logging-log4j-1.2.14.tar.gz from http://www.apache.org/dist/logging/log4j/1.2.14
--->  Verifying checksum(s) for jakarta-log4j
--->  Extracting jakarta-log4j
--->  Configuring jakarta-log4j
--->  Building jakarta-log4j with target log4j.jar javadoc
--->  Staging jakarta-log4j into destroot
--->  Installing jakarta-log4j 1.2.14_0
--->  Activating jakarta-log4j 1.2.14_0
--->  Cleaning jakarta-log4j
--->  Fetching servlet23-api
--->  Attempting to fetch servlet2.3-jsp1.2-tc4.x.tar.gz from http://svn.macports.org/repository/macports/distfiles/jberry
--->  Verifying checksum(s) for servlet23-api
--->  Extracting servlet23-api
--->  Configuring servlet23-api
--->  Building servlet23-api with target dist
--->  Staging servlet23-api into destroot
--->  Installing servlet23-api 1_0
--->  Activating servlet23-api 1_0
--->  Cleaning servlet23-api
--->  Fetching commons-logging
--->  Attempting to fetch commons-logging-1.1-src.tar.gz from http://www.apache.org/dist/commons/logging/source/
--->  Verifying checksum(s) for commons-logging
--->  Extracting commons-logging
--->  Configuring commons-logging
--->  Building commons-logging with target all
--->  Staging commons-logging into destroot
--->  Installing commons-logging 1.1_0
--->  Activating commons-logging 1.1_0
--->  Cleaning commons-logging
--->  Fetching commons-beanutils
--->  Attempting to fetch commons-beanutils-1.7.0-src.tar.gz from http://www.apache.org/dist/commons/beanutils/source/
--->  Verifying checksum(s) for commons-beanutils
--->  Extracting commons-beanutils
--->  Configuring commons-beanutils
--->  Building commons-beanutils with target jar javadoc
--->  Staging commons-beanutils into destroot
--->  Installing commons-beanutils 1.7.0_0
--->  Activating commons-beanutils 1.7.0_0
--->  Cleaning commons-beanutils
--->  Fetching commons-daemon
--->  Attempting to fetch daemon-1.0.1.tar.gz from http://www.apache.org/dist/commons/daemon/source/
--->  Verifying checksum(s) for commons-daemon
--->  Extracting commons-daemon
--->  Applying patches to commons-daemon
--->  Configuring commons-daemon
--->  Building commons-daemon with target all
--->  Staging commons-daemon into destroot
--->  Installing commons-daemon 1.0.1_0
--->  Activating commons-daemon 1.0.1_0
--->  Cleaning commons-daemon
--->  Fetching commons-pool
--->  Attempting to fetch commons-pool-1.3-src.tar.gz from http://www.apache.org/dist/commons/pool/source/
--->  Verifying checksum(s) for commons-pool
--->  Extracting commons-pool
--->  Configuring commons-pool
--->  Building commons-pool with target dist
--->  Staging commons-pool into destroot
--->  Installing commons-pool 1.3_1
--->  Activating commons-pool 1.3_1
--->  Cleaning commons-pool
--->  Fetching commons-dbcp
--->  Attempting to fetch commons-dbcp-1.2.2-src.tar.gz from http://www.apache.org/dist/commons/dbcp/source/
--->  Verifying checksum(s) for commons-dbcp
--->  Extracting commons-dbcp
--->  Configuring commons-dbcp
--->  Building commons-dbcp with target dist
--->  Staging commons-dbcp into destroot
--->  Installing commons-dbcp 1.2.2_0
--->  Activating commons-dbcp 1.2.2_0
--->  Cleaning commons-dbcp
--->  Fetching commons-digester
--->  Attempting to fetch commons-digester-1.8-src.tar.gz from http://www.apache.org/dist/commons/digester/source/
--->  Verifying checksum(s) for commons-digester
--->  Extracting commons-digester
--->  Configuring commons-digester
--->  Building commons-digester with target dist
--->  Staging commons-digester into destroot
--->  Installing commons-digester 1.8_0
--->  Activating commons-digester 1.8_0
--->  Cleaning commons-digester
--->  Fetching servlet24-api
--->  Attempting to fetch apache-tomcat-5.5.25-src.tar.gz from http://www.apache.org/dist/tomcat/tomcat-5/v5.5.25/src/
--->  Verifying checksum(s) for servlet24-api
--->  Extracting servlet24-api
--->  Configuring servlet24-api
--->  Building servlet24-api with target build-depends
--->  Staging servlet24-api into destroot
--->  Installing servlet24-api 5.5.25_0
--->  Activating servlet24-api 5.5.25_0
--->  Cleaning servlet24-api
--->  Fetching commons-el
--->  Attempting to fetch commons-el-1.0-src.tar.gz from http://www.apache.org/dist/commons/el/source/
--->  Verifying checksum(s) for commons-el
--->  Extracting commons-el
--->  Configuring commons-el
--->  Building commons-el with target jar javadoc
--->  Staging commons-el into destroot
--->  Installing commons-el 1.0_1
--->  Activating commons-el 1.0_1
--->  Cleaning commons-el
--->  Fetching commons-fileupload
--->  Attempting to fetch commons-fileupload-1.2-src.tar.gz from http://www.apache.org/dist/commons/fileupload/source/
--->  Verifying checksum(s) for commons-fileupload
--->  Extracting commons-fileupload
--->  Configuring commons-fileupload
--->  Building commons-fileupload with target dist
--->  Staging commons-fileupload into destroot
--->  Installing commons-fileupload 1.2_0
--->  Activating commons-fileupload 1.2_0
--->  Cleaning commons-fileupload
--->  Fetching commons-codec
--->  Attempting to fetch commons-codec-1.3-src.tar.gz from http://www.apache.org/dist/commons/codec/source/
--->  Verifying checksum(s) for commons-codec
--->  Extracting commons-codec
--->  Configuring commons-codec
--->  Building commons-codec with target dist
--->  Staging commons-codec into destroot
--->  Installing commons-codec 1.3_1
--->  Activating commons-codec 1.3_1
--->  Cleaning commons-codec
--->  Fetching commons-httpclient
--->  Attempting to fetch commons-httpclient-3.1-src.tar.gz from http://www.apache.org/dist/httpcomponents/commons-httpclient/source/
--->  Verifying checksum(s) for commons-httpclient
--->  Extracting commons-httpclient
--->  Configuring commons-httpclient
--->  Building commons-httpclient with target dist
--->  Staging commons-httpclient into destroot
--->  Installing commons-httpclient 3.1_0
--->  Activating commons-httpclient 3.1_0
--->  Cleaning commons-httpclient
--->  Fetching commons-io
--->  Attempting to fetch commons-io-1.3.2-src.tar.gz from http://www.apache.org/dist/commons/io/source/
--->  Verifying checksum(s) for commons-io
--->  Extracting commons-io
--->  Configuring commons-io
--->  Building commons-io with target dist
--->  Staging commons-io into destroot
--->  Installing commons-io 1.3.2_0
--->  Activating commons-io 1.3.2_0
--->  Cleaning commons-io
--->  Fetching commons-launcher
--->  Attempting to fetch commons-launcher-1.1-src.tar.gz from http://www.apache.org/dist/commons/launcher/source/
--->  Verifying checksum(s) for commons-launcher
--->  Extracting commons-launcher
--->  Configuring commons-launcher
--->  Building commons-launcher with target jar javadoc
--->  Staging commons-launcher into destroot
--->  Installing commons-launcher 1.1_0
--->  Activating commons-launcher 1.1_0
--->  Cleaning commons-launcher
--->  Fetching jakarta-regexp
--->  Attempting to fetch jakarta-regexp-1.4.tar.gz from http://www.apache.org/dist/jakarta/regexp/source
--->  Verifying checksum(s) for jakarta-regexp
--->  Extracting jakarta-regexp
--->  Configuring jakarta-regexp
--->  Building jakarta-regexp with target jar
--->  Staging jakarta-regexp into destroot
--->  Installing jakarta-regexp 1.4_0
--->  Activating jakarta-regexp 1.4_0
--->  Cleaning jakarta-regexp
--->  Fetching jakarta-bcel
--->  Attempting to fetch bcel-5.1-src.tar.gz from http://www.apache.org/dist/jakarta/bcel/source/
--->  Attempting to fetch bcel-5.1-src.tar.gz from http://apache.planetmirror.com.au/dist/jakarta/bcel/source/
--->  Attempting to fetch bcel-5.1-src.tar.gz from ftp://ftp.planetmirror.com/pub/apache/dist/jakarta/bcel/source/
--->  Verifying checksum(s) for jakarta-bcel
--->  Extracting jakarta-bcel
--->  Applying patches to jakarta-bcel
--->  Configuring jakarta-bcel
--->  Building jakarta-bcel with target jar
--->  Staging jakarta-bcel into destroot
--->  Installing jakarta-bcel 5.1_1
--->  Activating jakarta-bcel 5.1_1
--->  Cleaning jakarta-bcel
--->  Fetching mx4j
--->  Attempting to fetch mx4j-3.0.1-src.tar.gz from http://downloads.sourceforge.net/mx4j
--->  Verifying checksum(s) for mx4j
--->  Extracting mx4j
--->  Configuring mx4j
--->  Building mx4j with target compile.jmx compile.rjmx
--->  Staging mx4j into destroot
--->  Installing mx4j 3.0.1_0
--->  Activating mx4j 3.0.1_0
--->  Cleaning mx4j
--->  Fetching commons-modeler
--->  Attempting to fetch commons-modeler-2.0.1-src.tar.gz from http://www.apache.org/dist/commons/modeler/source/
--->  Verifying checksum(s) for commons-modeler
--->  Extracting commons-modeler
--->  Configuring commons-modeler
--->  Building commons-modeler with target init-dist prepare jar javadoc
--->  Staging commons-modeler into destroot
--->  Installing commons-modeler 2.0.1_0
--->  Activating commons-modeler 2.0.1_0
--->  Cleaning commons-modeler
--->  Fetching xercesj
--->  Attempting to fetch Xerces-J-src.2.9.1.tar.gz from http://www.apache.org/dist/xml/xerces-j/
--->  Attempting to fetch Xerces-J-tools.2.9.1.tar.gz from http://www.apache.org/dist/xml/xerces-j/
--->  Verifying checksum(s) for xercesj
--->  Extracting xercesj
--->  Configuring xercesj
--->  Building xercesj with target jars docs javadocs
--->  Staging xercesj into destroot
--->  Installing xercesj 2.9.1_0
--->  Activating xercesj 2.9.1_0
--->  Cleaning xercesj
--->  Fetching xalanj
--->  Attempting to fetch xalan-j_2_7_0-src.tar.gz from http://www.apache.org/dist/xml/xalan-j/source/
--->  Attempting to fetch xalan-j_2_7_0-src.tar.gz from http://apache.planetmirror.com.au/dist/xml/xalan-j/source/
--->  Attempting to fetch xalan-j_2_7_0-src.tar.gz from ftp://ftp.planetmirror.com/pub/apache/dist/xml/xalan-j/source/
--->  Verifying checksum(s) for xalanj
--->  Extracting xalanj
--->  Configuring xalanj
--->  Building xalanj with target all docs javadocs
--->  Staging xalanj into destroot
--->  Installing xalanj 2.7.0_1
--->  Activating xalanj 2.7.0_1
--->  Cleaning xalanj
--->  Fetching jakarta-taglibs-standard-11
--->  Attempting to fetch jakarta-taglibs-standard-1.1.2-src.tar.gz from http://www.apache.org/dist/jakarta/taglibs/standard/source/
--->  Verifying checksum(s) for jakarta-taglibs-standard-11
--->  Extracting jakarta-taglibs-standard-11
--->  Configuring jakarta-taglibs-standard-11
--->  Building jakarta-taglibs-standard-11 with target dist
--->  Staging jakarta-taglibs-standard-11 into destroot
--->  Installing jakarta-taglibs-standard-11 1.1.2_1
--->  Activating jakarta-taglibs-standard-11 1.1.2_1
--->  Cleaning jakarta-taglibs-standard-11
--->  Fetching dom4j
--->  Attempting to fetch dom4j-1.6.1.tar.gz from http://downloads.sourceforge.net/dom4j
--->  Verifying checksum(s) for dom4j
--->  Extracting dom4j
--->  Applying patches to dom4j
--->  Configuring dom4j
--->  Building dom4j with target all
--->  Staging dom4j into destroot
--->  Installing dom4j 1.6.1_1
--->  Activating dom4j 1.6.1_1
--->  Cleaning dom4j
--->  Fetching jdom
--->  Attempting to fetch jdom-1.0.tar.gz from http://www.jdom.org/dist/source/
--->  Attempting to fetch jdom-1.0.tar.gz from http://www.jdom.org/dist/source/archive/
--->  Verifying checksum(s) for jdom
--->  Extracting jdom
--->  Configuring jdom
--->  Building jdom with target package javadoc
--->  Staging jdom into destroot
--->  Installing jdom 1.0_0
--->  Activating jdom 1.0_0
--->  Cleaning jdom
--->  Fetching xom
--->  Attempting to fetch xom-1.0.tar.gz from http://www.cafeconleche.org/XOM/
--->  Verifying checksum(s) for xom
--->  Extracting xom
--->  Configuring xom
--->  Building xom with target jar javadoc
--->  Staging xom into destroot
--->  Installing xom 1.0_0
--->  Activating xom 1.0_0
--->  Cleaning xom
--->  Fetching jaxen
--->  Attempting to fetch jaxen-1.1-beta-9-src.tar.gz from http://dist.codehaus.org/jaxen/distributions/
--->  Verifying checksum(s) for jaxen
--->  Extracting jaxen
--->  Configuring jaxen
--->  Building jaxen with target dist
--->  Staging jaxen into destroot
--->  Installing jaxen 1.1-beta-9_0
--->  Activating jaxen 1.1-beta-9_0
--->  Cleaning jaxen
--->  Fetching saxpath
--->  Attempting to fetch saxpath-1.0.tar.gz from http://downloads.sourceforge.net/saxpath
--->  Verifying checksum(s) for saxpath
--->  Extracting saxpath
--->  Configuring saxpath
--->  Building saxpath with target package
--->  Staging saxpath into destroot
--->  Installing saxpath 1.0_0
--->  Activating saxpath 1.0_0
--->  Cleaning saxpath
--->  Fetching tomcat5
--->  Attempting to fetch apache-tomcat-5.5.25-src.tar.gz from http://www.apache.org/dist/tomcat/tomcat-5/v5.5.25/src/
--->  Attempting to fetch apache-tomcat-5.5.25-src.tar.gz from http://apache.planetmirror.com.au/dist/tomcat/tomcat-5/v5.5.25/src/
--->  Attempting to fetch apache-tomcat-5.5.25-src.tar.gz from ftp://ftp.planetmirror.com/pub/apache/dist/tomcat/tomcat-5/v5.5.25/src/
--->  Verifying checksum(s) for tomcat5
--->  Extracting tomcat5
--->  Applying patches to tomcat5
--->  Configuring tomcat5
--->  Building tomcat5 with target download dist compat
--->  Staging tomcat5 into destroot
--->  Creating launchd control script
###########################################################
# A startup item has been generated that will aid in
# starting tomcat5 with launchd. It is disabled
# by default. Execute the following command to start it,
# and to cause it to launch at startup:
#
# sudo launchctl load -w /Library/LaunchDaemons/org.macports.tomcat5.plist
###########################################################
--->  Installing tomcat5 5.5.25_0
#
# Configuration files in /opt/local/share/java/tomcat5/conf have been
# installed with a .sample extension so that they won't be replaced by a
# port update. Each will be copied to its proper location during the
# first startup of tomcat by catalina.sh or tomcatctl if you don't
# do this yourself first. If this _is_ an update, you might do a diff to
# verify that you're not missing anything in the newer .sample versions
# of these files.
#
# The script /opt/local/share/java/tomcat5/bin/tomcatctl has been installed to
# facilitate start and stop of tomcat using the jsvc utility, which allows you to
# start tomcat as a true daemon process. Once tomcat has acquired its TCP socket,
# jsvc will drop its root privileges and run as user www.
#
# Under Apple Java, control over the Java version used to launch tomcat5 is
# through the shell variable JAVA_JVM_VERSION. This variable should be set
# to a java version such as 1.4, 1.5, or CurrentJDK (for the default version).
# You may set JAVA_JVM_VERSION in /opt/local/share/java/tomcat5/bin/setenv.sh.
#
--->  Activating tomcat5 5.5.25_0
--->  Cleaning tomcat5