原文地址: http://www.jianshu.com/p/4811f11aed27
本文是自己实际开发过程中遇到的问题。
1、准备
1.1、Xcode
`XCode`提供了Mac平台开发环境必须的gcc编译器,要注意的是`XCode` 安装后并没有命令行的gcc可用,
还需要打开`XCode`,在某个设置里添加Command Line Tools,`XCode`就会自动下载并安装好gcc,
同时还有git也被安装了。
1.2、Homebrew
`homebre` 是 Mac 平台上的一个包管理工具,提供了许多 Mac 下没有的 Linux工具等,
而且安装工具极其简单,一句命令行 gameOver。
2、安装FFmpeg
ffmpeg的官方网站是:http://ffmpeg.org/
2.1、在终端输入以下命令行:
zhuyuhui-4:~ zhuyuhui$ brew install ffmpeg Updating Homebrew... ==> Auto-updated Homebrew! Updated 1 tap (homebrew/core). ==> New Formulae bchunk elasticsearch@5.6 kibana@5.6 logstash@5.6 ==> Updated Formulae apibuilder-cli grafana mercurial sassc arangodb grakn metricbeat scons azure-cli grpc mighttpd2 shpotify bitrise harfbuzz mosh sonarqube citus heartbeat nickle streamlink commandbox influxdb open-scene-graph supersonic couchdb itstool opencoarrays swift-protobuf cppad jfrog-cli-go opusfile terragrunt crystal-icr kibana paket traefik dbus kotlin pgrouting upscaledb elasticsearch libfaketime planck urh faac libopusenc poco vault faas-cli libphonenumber pqiv xtensor filebeat libtrace protobuf youtube-dl fn lighttpd protobuf-c zbackup folly logstash protobuf-swift zenity git-cinnabar lxc pumba zimg gjstest mariadb@10.1 purescript Error: Your Xcode (8.3.3) is too outdated. Please update to Xcode 9.1 (or delete it). Xcode can be updated from the App Store. zhuyuhui-4:~ zhuyuhui$
我的电脑上同时安装了Xcode8.3.3和Xcode9.0.1[两个Xcode都安装在Applications]。出现上述错误,找到解决方法如下:
https://stackoverflow.com/questions/40296756/homebrew-saying-xcode-is-outdated
So as @NicolasMiari mentioned in a comment above, the fix to my issue ended up having to
have both Xcode 7 and Xcode 8 on my machine. I went on the apple developer site, downloaded Xcode 8,
saved it to my documents and then used: sudo xcode-select -switch ~/Documents/Xcode.app/ and then ran my brew install which worked as expected. Afterwards I ran: sudo xcode-select -switch /Applications/Xcode.app/ to switch back to Xcode 7.3.1. Hope this helps someone else! and thanks for the suggestions!
按照上述方法,先执行
sudo xcode-select -switch /Applications/Xcode9.app/
然后执行下面代码:
Last login: Thu Nov 16 09:11:31 on console zhuyuhui-4:~ zhuyuhui$ brew install ffmpeg Updating Homebrew... ==> Auto-updated Homebrew! Updated 1 tap (homebrew/core). ==> New Formulae bchunk elasticsearch@5.6 kibana@5.6 logstash@5.6 ==> Updated Formulae apibuilder-cli grafana mercurial sassc arangodb grakn metricbeat scons azure-cli grpc mighttpd2 shpotify bitrise harfbuzz mosh sonarqube citus heartbeat nickle streamlink commandbox influxdb open-scene-graph supersonic couchdb itstool opencoarrays swift-protobuf cppad jfrog-cli-go opusfile terragrunt crystal-icr kibana paket traefik dbus kotlin pgrouting upscaledb elasticsearch libfaketime planck urh faac libopusenc poco vault faas-cli libphonenumber pqiv xtensor filebeat libtrace protobuf youtube-dl fn lighttpd protobuf-c zbackup folly logstash protobuf-swift zenity git-cinnabar lxc pumba zimg gjstest mariadb@10.1 purescript Error: Your Xcode (8.3.3) is too outdated. Please update to Xcode 9.1 (or delete it). Xcode can be updated from the App Store. zhuyuhui-4:~ zhuyuhui$ brew install ffmpeg Updating Homebrew... ==> Installing dependencies for ffmpeg: lame, x264, xvid ==> Installing ffmpeg dependency: lame ==> Downloading https://homebrew.bintray.com/bottles/lame-3.99.5.high_sierra.bot ######################################################################## 100.0% ==> Pouring lame-3.99.5.high_sierra.bottle.1.tar.gz