強火で進め

このブログではプログラム関連の記事を中心に書いてます。

MacPortsで Error: Unable to open port: can't read "build.cmd" とエラーが出た時の対処方法

MacPortsでこの様なエラーが発生。

"Error: Unable to open port: can't read "build.cmd": Failed to locate 'make' in path: '/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin' or at its MacPorts configuration time location, did you move it?"

/Developer/usr/bin/ へパスを通す様な対応方法なども見つかりましたがこちらの方法では根本的な解決にはなりませんでした。

後、詳しくエラーをたどってみるとログファイルに以下のエラーが発生していました。

:info:configure configure: error: C compiler cannot create executables

このエラーについて調べてみるとこちらの System Tools と Unix Development を含んだ状態でXcodeをインストールするとOKという対応が正解の様でした。

しかし、現在のXcode(バージョン 4.3.2)ではインストラー経由では無く、AppStoreから直接インストールされてしまう為、その様な選択をする場所が有りません。

現在のXcodeでは代わりに後からインストールする事が出来る様になっています。 command+, で環境設定を開き、「Downdloads」タブ中の「Components」タブを開きます。

その画面の「Command Line Tools」の「Install」ボタンを押すとインストールする事が出来ます。