核心提示:
回想你是不是更新过xcode,而且更新过后,还没有使用过。如果是,请同意一下命令行版的用户协议,终端里运行
sudo xcodebuild -license然后按提示输入 agree,完了重试port更新。
如果不是这样,那请转到google搜索,并啃英文资料吧。
其实只需要看到这里就够了,下面是发现这一点的过程,可以认为是废话,不推荐继续阅读;读了也不多,多花费一点时间而已。
mac port 用了一段时间,需要更新,但是出错了,如下:
sh-3.2# port selfupdate
---> Updating MacPorts base sources using rsync
MacPorts base version 2.3.3 installed,
MacPorts base version 2.3.4 downloaded.
---> Updating the ports tree
---> MacPorts base is outdated, installing new version 2.3.4
Installing new MacPorts release in /opt/local as root:admin; permissions 0755
Error: Error installing new MacPorts base: command execution failed
Please run `port -v selfupdate' for details.
Error: /opt/local/bin/port: port selfupdate failed: Error installing new MacPorts base: command execution failed那就按提示,带-v参数,看详细信息
sh-3.2# port -v selfupdate
checking Mac OS X version... 10.10.5
checking Xcode location... /Applications/Xcode.app/Contents/Developer
checking Xcode version... 7.1.1
checking whether the C compiler works... no
configure: error: in `/opt/local/var/macports/sources/sea.us.rsync.macports.org/release/tarballs/base':
configure: error: C compiler cannot create executables
See `config.log' for more details
Command failed: cd /opt/local/var/macports/sources/sea.us.rsync.macports.org/release/tarballs/base && CC=/usr/bin/cc OBJC=/usr/bin/cc ./configure --prefix=/opt/local --with-install-user=root --with-install-group=admin --with-directory-mode=0755 --enable-readline && make SELFUPDATING=1 && make install SELFUPDATING=1
Exit code: 77
Error: Error installing new MacPorts base: command execution failed
To report a bug, follow the instructions in the guide:
http://guide.macpo***rts.org/#project.tickets
Error: /opt/local/bin/port: port selfupdate failed: Error installing new MacPorts base: command execution failed看上面消息里的 Command failed 一行,原始命令竟然是 cc 报错,新打开一个终端页,运行cc,果然是不正常的,如下
fsmac:~ feng$ cc
Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.
fsmac:~ feng$ cc -v
Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.
fsmac:~ feng$ cc --version
Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.没有仔细看,google了一下前面错误消息,国外社区里有相关帖子http://st*ack*o*verflow.com/questions/19622337/cant-update-macports-with-mac-os-x-mavericks ,说
Install the "Command Line Tools" first
sudo xcode-select --install这货之前确实安装过,又往下看,有说
There might be a chance that you haven’t agreed with the XCode license. If xcode-install doesn’t help, you can run the belowing command to agree with Xcode license. sudo xcodebuild -license
回想一下,果然,前几天安应用商店里更新了xcode,这货更新了,但还得再次确认一下同意协议,苹果真够??碌?/p>
fsmac:~ feng$ sudo xcodebuild -license
You have not agreed to the Xcode license agreements. You must agree to both license agreements below in order to use Xcode.
Hit the Enter key to view the license agreements at '/Applications/Xcode.app/Contents/Resources/English.lproj/License.rtf'
Apple Inc.
Xcode and Apple SDKs Agreement
......
By typing 'agree' you are agreeing to the terms of the software license agreements. Type 'print' to print them or anything else to cancel, [agree, print, cancel]
agree后,再运行,正常的了
fsmac:~ feng$ cc
clang: error: no input files
fsmac:~ feng$ cc --version
Apple LLVM version 7.0.0 (clang-700.1.76)
Target: x86_64-apple-darwin14.5.0
Thread model: posix
原神祈愿模拟器最新版
原神祈愿模拟器手机版是一款完整汉化的趣味原神抽卡模拟小游戏,
宝宝森林美食完整版
宝宝森林美食游戏最新版是一款十分有趣的休闲益智游戏,帮助宝宝
g沙盒仇恨官方英文版(gorebox)
G沙盒仇恨英文原版是一款最近非常火热的沙盒模拟类游戏,在这里
迷你世界测试服最新版2024
迷你世界测试服2021最新版,即迷你世界的先遣服版本,用户能
闪耀暖暖最新版2024
闪耀暖暖手游这是非常好玩的换装手游,游戏内容丰富有趣,游戏环