未処分利益

日記 メモ 映画 小説 感想 読書 Android iOS

macportでselfupdateが失敗する件

以下環境でmacportでselfupdateをすると失敗する現象が発生

[環境] MacOS X (lion) Xcode 4.3.2

APPLE MacBook Pro 13.3/2.5GHz Core i5/4GB/500GB/8xSuperDrive DL MD101J/A

APPLE MacBook Pro 13.3/2.5GHz Core i5/4GB/500GB/8xSuperDrive DL MD101J/A

[コマンド1]

sudo port update selfupdate

[エラー内容]

Error: /opt/local/bin/port: port selfupdate failed: Error installing new MacPorts base: command execution failed

上記のエラー内容だけでは根本原因が不明なのでデバックしながらupdate

[コマンド2]

sudo port -d update selfupdate

すると以下の通り./configureで原因に近づけるような箇所を発見

checking build system type... i386-apple-darwin11.4.0
checking host system type... i386-apple-darwin11.4.0
checking target system type... i386-apple-darwin11.4.0
checking MacPorts version... 2.1.1
checking for sw_vers... /usr/bin/sw_vers
checking for defaults... /usr/bin/defaults
checking for xcode-select... /usr/bin/xcode-select
checking Mac OS X version... 10.7.4
checking Xcode location... /Applications/Xcode.app/Contents/Developer
checking Xcode version... 4.3.2
checking for gcc... /usr/bin/cc
checking whether the C compiler works... no
configure: error: in `/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/base':
configure: error: C compiler cannot create executables

どうもXcode Toolsとの連携が上手くいっていない感じねー。

というわけで本家のサイト調べていたら、以下のURLに解決策を発見。

https://trac.macports.org/wiki/ProblemHotlist#xcode43 macportでの連携で必要なCommand Line ToolsがXcode 4.3からではデフォルトで入っていないことが原因。

個別にインストールする必要があるので

Xcode起動→Preference→DownLoads→Command Line Tools

でダウンロード&インストールした後に再度コマンド1をしてあげたら以下の通りです。

Congratulations, you have successfully upgraded the MacPorts system.