brew

https://github.com/Homebrew/homebrew-php
https://github.com/Homebrew/homebrew-core
Homebrew是Mac下得套件管理器,类似于Linux系统中的 yum 或者 apt-get ,它能让你的Mac更完美。
安装:
ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
卸载:
ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)”
// 当你记不清软件的名字的时候,你可以使用search,只需要写去几个字母,他就会帮你联想,并把所有可能的结果输出给你
brew search
查看使用brew安装的东西,安装在哪里
brew –cache
/Users/didi/Library/Caches/Homebrew

Homebrew 是基于 OS X 的套件管理工具,是一个开源的 Ruby 脚本,专门用于快速下载软件;



通俗地讲,Homebrew 类似于一个软件中心,可以理解成 App Store 或者 Google Play 那样的软件商店, 且内容更加丰富;



Homebrew Cask,它是一套建立在 Homebrew 基础之上的 OS X 软件安装命令行工具,是 Homebrew 的扩展;



https://brew.sh/index_zh-cn.html



修改Hosts临时解决GitHub的raw.githubusercontent.com无法链接的问题



查询真实IP
通过IPAddress.com首页,输入raw.githubusercontent.com查询到真实IP地址
https://www.ipaddress.com/



https://githubusercontent.com.ipaddress.com/raw.githubusercontent.com



199.232.68.133



修改hosts
CentOS及macOS直接在终端输入



sudo vi /etc/hosts
添加以下内容保存即可



199.232.68.133 raw.githubusercontent.com



https://www.ioiox.com/archives/62.html



方法二:
https://www.ioiox.com/archives/102.html
使用gh-proxy来代理访问



gh-proxy 是一款 github release、archive以及项目文件的加速项目,支持直接在终端 git clone ,也可以在 web 端代理下载 github 以及 raw.githubusercontent.com 等文件.



https://github.com/hunshcn/gh-proxy



https://g.ioiox.com/



Web 端直接粘贴 Github 项目或文件直链点击下载即可.
也支持wget、curl等需要直链方式的软件,仅需在直链之前加上https://g.ioiox.com/即可.
脚本中可以设置变量,批量在直链前加入代理变量.



git clone
使用终端登陆服务器也可以使用git clone命令来下载仓库.
常规命令: git clone https://github.com/xxx/xxx.git
代理命令: git clone https://g.ioiox.com/https://github.com/xxx/xxx.git



https://g.ioiox.com/



https://segmentfault.com/a/1190000022406854



更换国内源
cd “$(brew –repo)”
git remote set-url origin git://mirrors.ustc.edu.cn/brew.git
cd “$(brew –repo)/Library/Taps/homebrew/homebrew-core”
git remote set-url origin git://mirrors.ustc.edu.cn/homebrew-core.git
默认不安装cask 有需要的可以替换



cd “/usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask”
git remote set-url origin git://mirrors.ustc.edu.cn/homebrew-cask.git



如果上面这个镜像不能用或者觉得慢,你可以用清华大学。



该镜像是 Homebrew 的 formula 索引的镜像(即 brew update 时所更新内容)。
cd “$(brew –repo)”
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git



cd “$(brew –repo)/Library/Taps/homebrew/homebrew-core”
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git



brew update



使用homebrew-science或者homebrew-python
cd “$(brew –repo)/Library/Taps/homebrew/homebrew-science”
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-science.git



cd “$(brew –repo)/Library/Taps/homebrew/homebrew-python”
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-python.git



brew update



卸载可使用如下命令
$ cd brew --prefix
$ rm -rf Cellar
$ brew prune
$ rm git ls-files
$ rm -r Library/Homebrew Library/Aliases Library/Formula Library/Contributions
$ rm -rf .git
$ rm -rf ~/Library/Caches/Homebrew



https://github.com/Homebrew/brew#homebrew



$ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
dyld: Library not loaded: /usr/local/opt/gmp/lib/libgmp.10.dylib
Referenced from: /Users/didi/.rvm/rubies/ruby-2.4.0/bin/ruby
Reason: image not found
Trace/BPT trap: 5



https://stackoverflow.com/questions/17703510/dyld-library-not-loaded-reason-image-not-found



$ otool -L exefile
error: /Library/Developer/CommandLineTools/usr/bin/otool: can’t open file: exefile (No such file or directory)



https://github.com/asdf-vm/asdf
https://asdf-vm.com/#/core-manage-asdf-vm



1、先安装好 RVM



RVM 是一个便捷的多版本 ruby 环境的管理和切换工具



官网:https://rvm.io/



1.1 在终端控制台命令:










$ curl -sSL https://get.rvm.io bash -s stable 之后按回车键


如下所示:



1.2 然后,载入 RVM 环境:



$ source ~/.rvm/scripts/rvm



1.3 修改 RVM 下载 Ruby 的源,到 Ruby China 的镜像: !!!记住这个镜像 是 ruby-china.org 不是其他的。



echo “ruby_url=https://cache.ruby-china.org/pub/ruby” > ~/.rvm/user/db



1.3.1 检查一下是否安装正确



$ rvm -v



如果能显示版本号,则安装成功。



如果之前安装过 RVM 想要更新,则 



$ rvm get stable



2、安装 ruby



列出 ruby 可安装的版本信息 (这里安装的是 2.4.0 的)



$ rvm list known



安装一个ruby版本



$ rvm install 2.4.0



如果想设置为默认版本,可以用这条命令来完成



$ rvm use 2.4.0 –default



3、重装Ruby



经常碰到项目的Pod install 问题,如下提示,表示ruby版本不匹配,无法找到方法GundamStartUp。需要安装低版本的ruby,如2.4.0.



[!] Invalid Podfile file: .



#  from /Users/xxx/Documents/xxx/xxx/xxx/Podfile:4



#  ——————————————-



#  require  “./GUNDAM/Gundam.rb”




  GundamStartUp(self)






#  ——————————————-



3.1 rvm uninstall 你当前的ruby版本



3.2 如果无法卸载,提示如下:



Error running ‘__rvm_rm_rf /Users/xxx/.rvm/rubies/ruby-2.6.0-preview2’,



please read /Users/xxx/.rvm/log/1538210544_ruby-2.6.0-preview2/remove.rubies.log



可以使用remove命令,sudo rvm remove 2.6.0,完全移除。



3.3 安装需要的版本



rvm ruby 2.4.1



3.4 安装指定的cocoaPods版本



sudo gem install cocoapods –version



gem的相关操作
gem sources –remove https://gems.ruby-china.org/



gem sources -a https://gems.ruby-china.com/



gem sources -l










gem list –local grep cocoapods


sudo gem update –system



sudo gem update –system 2.7.6



gem uninstall cocoapods -v 1.5.3



sudo gem install cocoapods –version 1.3.1



续1:如果遇到RVM的问题:



https://stackoverflow.com/questions/32965735/cocoapods-points-to-wrong-version —-issue



https://stackoverflow.com/questions/25016382/cocoa-pods-need-to-completely-re-install/25021772#25021772 —-solution



Here is what I found out : In my case it was that RVM was not installed correctly so RubyGems wasn’t installed correctly. That in turn made CocoaPods not install correctly.



1、To completely uninstall and remove RVM: 



sudo rvm implode or you can do sudo rm -rf ~/.rvm



2、Reinstall RVM by doing this: 










curl -sSL https://get.rvm.io bash -s stable –ruby


3、Reinstall CocoaPods like this: 



gem install cocoapods



$ rvm -v
Warning! PATH is not properly set up, ‘/Users/didi/.rvm/gems/ruby-2.4.0/bin’ is not at first place.
Usually this is caused by shell initialization files. Search for ‘PATH=…’ entries.
You can also re-add RVM to your profile by running: ‘rvm get stable –auto-dotfiles’.
To fix it temporarily in this shell session run: ‘rvm use ruby-2.4.0’.
To ignore this error add rvm_silence_path_mismatch_check_flag=1 to your ~/.rvmrc file.
rvm 1.29.2 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io/]



$rvm get stable –auto-dotfiles
Warning! PATH is not properly set up, ‘/Users/didi/.rvm/gems/ruby-2.4.0/bin’ is not at first place.



$rvm -v
Warning! PATH is not properly set up, /Users/didi/.rvm/gems/ruby-2.4.0/bin is not at first place.



$vi .bashrc
export GEM_HOME=”/Users/didi/.rvm/gems/ruby-2.4.0”



移动到第一位



$brew search php
==> Formulae
brew-php-switcher php@7.3
homebrew/nginx/php-session-nginx-module phplint
php phpmd
php-code-sniffer phpmyadmin
php-cs-fixer phpstan
php@7.2 phpunit



$brew install php@7.2



$php -v
PHP 7.2.0-dev (cli) (built: May 20 2020 23:46:30) ( NTS DEBUG )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.1.0-dev, Copyright (c) 1998-2016 Zend Technologies



$which php
/usr/local/bin/php



$jekyll s
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require’: cannot load such file – maruku (LoadError)



https://rubygems.org/gems/maruku



Maruku is a Markdown interpreter in Ruby. It features native export to HTML and PDF (via Latex). The output is really beautiful!



$ gem install maruku
ERROR: Could not find a valid gem ‘maruku’ (>= 0), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: tlsv1 alert protocol version (https://api.rubygems.org/specs.4.8.gz)



$vi Gemfile



gem ‘maruku’, ‘~> 0.7.3’



$gem install maruku
速度太慢
改gem 镜像源到国内



$gem sources –add https://mirrors.tuna.tsinghua.edu.cn/rubygems/ –remove https://rubygems.org/
ERROR: SSL verification error at depth 1: unable to get local issuer certificate (20)
ERROR: You must add /O=Digital Signature Trust Co./CN=DST Root CA X3 to your local trusted store
https://mirrors.tuna.tsinghua.edu.cn/rubygems/ added to sources
https://rubygems.org/ removed from sources



$sudo gem install maruku
Password:
ERROR: SSL verification error at depth 1: unable to get local issuer certificate (20)
ERROR: You must add /O=Digital Signature Trust Co./CN=DST Root CA X3 to your local trusted store
Fetching: maruku-0.7.3.gem (100%)
ERROR: While executing gem … (Errno::EPERM)
Operation not permitted - /usr/bin/maruku



$gem environment
RubyGems Environment:



  • RUBYGEMS VERSION: 2.6.13

  • RUBY VERSION: 2.0.0 (2015-04-13 patchlevel 645) [universal.x86_64-darwin15]

  • INSTALLATION DIRECTORY: /Library/Ruby/Gems/2.0.0

  • USER INSTALLATION DIRECTORY: /Users/didi/.gem/ruby/2.0.0

  • RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby

  • EXECUTABLE DIRECTORY: /usr/bin



$sudo gem install -n /usr/local/bin maruku
Password:
ERROR: SSL verification error at depth 1: unable to get local issuer certificate (20)
ERROR: You must add /O=Digital Signature Trust Co./CN=DST Root CA X3 to your local trusted store
Successfully installed maruku-0.7.3
Parsing documentation for maruku-0.7.3
Installing ri documentation for maruku-0.7.3
1 gem installed



$bundler
The latest bundler is 1.16.1, but you are currently running 1.15.4.
#source “https://rubygems.org”
source ‘https://gems.ruby-china.com’


Hello! This is where you manage which Jekyll version is used to run.


When you want to use a different version, change it below, save the


file and run bundle install. Run Jekyll with bundle exec, like so:


#


bundle exec jekyll serve


#


This will help ensure the proper Jekyll version is running.


Happy Jekylling!


gem “jekyll”, “~> 3.6.0.pre.beta1”



This is the default theme for new Jekyll sites. You may change this to anything you like.


gem “minima”, “~> 2.0”
“Gemfile” 30L, 1099C written
To update, run gem install bundler
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java.
Fetching source index from https://rubygems.org/



Retrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from https://rubygems.org/
Retrying fetcher due to error (3/4): Bundler::HTTPError Could not fetch specs from https://rubygems.org/
Retrying fetcher due to error (4/4): Bundler::HTTPError Could not fetch specs from https://rubygems.org/
Could not fetch specs from https://rubygems.org/



source ‘https://rubygems.org’


source ‘https://gems.ruby-china.com’



$bundle install
bundle: cannot find package in current directory: no buildable Go source files in /Users/didi/blog/MyBlog



$bundler
The latest bundler is 1.16.1, but you are currently running 1.15.4.
To update, run gem install bundler
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java.
Fetching gem metadata from https://gems.ruby-china.com/…………
Fetching version metadata from https://gems.ruby-china.com/…
Fetching dependency metadata from https://gems.ruby-china.com/..
Resolving dependencies…
Fetching public_suffix 3.0.2
Installing public_suffix 3.0.2
Using bundler 1.15.4
Fetching colorator 1.1.0
Installing colorator 1.1.0
Fetching ffi 1.9.23
Installing ffi 1.9.23 with native extensions
Fetching forwardable-extended 2.6.0
Installing forwardable-extended 2.6.0
Fetching rb-fsevent 0.10.2
Installing rb-fsevent 0.10.2
Fetching ruby_dep 1.5.0
Installing ruby_dep 1.5.0
Fetching kramdown 1.16.2
Installing kramdown 1.16.2
Fetching liquid 4.0.0
Installing liquid 4.0.0
Fetching mercenary 0.3.6
Installing mercenary 0.3.6
Fetching rouge 2.2.1
Installing rouge 2.2.1
Fetching safe_yaml 1.0.4
Installing safe_yaml 1.0.4
Fetching jekyll-paginate 1.1.0
Installing jekyll-paginate 1.1.0
Fetching maruku 0.7.3
Installing maruku 0.7.3
Fetching multi_json 1.13.1
Installing multi_json 1.13.1
Gem::InstallError: public_suffix requires Ruby version >= 2.1.
An error occurred while installing public_suffix (3.0.2), and
Bundler cannot continue.
Make sure that gem install public_suffix -v '3.0.2' succeeds before
bundling.



In Gemfile:
minima was resolved to 2.3.0, which depends on
jekyll-feed was resolved to 0.9.3, which depends on
jekyll was resolved to 3.6.2, which depends on
addressable was resolved to 2.5.2, which depends on
public_suffix



$ gem install public_suffix -v ‘3.0.2’
ERROR: SSL verification error at depth 1: unable to get local issuer certificate (20)
ERROR: You must add /O=Digital Signature Trust Co./CN=DST Root CA X3 to your local trusted store
ERROR: While executing gem … (Gem::FilePermissionError)
You don’t have write permissions for the /Library/Ruby/Gems/2.0.0 directory.



$sudo gem install public_suffix -v ‘3.0.2’
Password:
ERROR: SSL verification error at depth 1: unable to get local issuer certificate (20)
ERROR: You must add /O=Digital Signature Trust Co./CN=DST Root CA X3 to your local trusted store
Fetching: public_suffix-3.0.2.gem (100%)
ERROR: Error installing public_suffix:
public_suffix requires Ruby version >= 2.1.



新版本ruby才行
$ rvm list known


MRI Rubies


[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-head] # security released on head
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p330]
[ruby-]1.9.3[-p551]
[ruby-]2.0.0[-p648]



$rvm install 2.2.0 –disable-binary
Checking requirements for osx.
Installing requirements for osx.
Updating system………..



https://ruby-china.org/wiki/rvm-guide



$rvm install 2.2.0 –disable-binary
Checking requirements for osx.
Installing requirements for osx.
Updating system………..



..Failed to update Homebrew, follow instructions at



https://docs.brew.sh/Common-Issues


and make sure brew update works before continuing.
..
Error running ‘requirements_osx_brew_update_system ruby-2.2.0’,
please read /Users/didi/.rvm/log/1590041317_ruby-2.2.0/update_system.log
Requirements installation failed with status: 1.



$ brew update
Warning: You are using macOS 10.11.
We (and Apple) do not provide support for this old version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew’s GitHub,
Discourse, Twitter or IRC. You are responsible for resolving any issues you
experience while you are running this old version.



==> Downloading https://ftp.gnu.org/gnu/gettext/gettext-0.20.1.tar.xz
Already downloaded: /Users/didi/Library/Caches/Homebrew/downloads/ae9054eb313c4bc212a180985b803835865e320d827a3e0f677a9f89ea251d24–gettext-0.20.1.tar.xz
==> Downloading https://ftp.pcre.org/pub/pcre/pcre2-10.34.tar.bz2
Already downloaded: /Users/didi/Library/Caches/Homebrew/downloads/b08f20d116fa04589856a1913eceff5c7566b1288a0b0cad3864ba023258f360–pcre2-10.34.tar.bz2
==> Downloading https://www.kernel.org/pub/software/scm/git/git-htmldocs-2.26.0.
Already downloaded: /Users/didi/Library/Caches/Homebrew/downloads/5d57293cbd0867bd9875f536894145ddb5ce50eb16d0448fbe91c730c30a0147–git-htmldocs-2.26.0.tar.xz
==> Downloading https://www.kernel.org/pub/software/scm/git/git-manpages-2.26.0.
Already downloaded: /Users/didi/Library/Caches/Homebrew/downloads/803896fd35e4697f679a2b36981119348c37a5a4c2a6894bf6e20b06099c1780–git-manpages-2.26.0.tar.xz
==> Downloading https://cpan.metacpan.org/authors/id/R/RJ/RJBS/Net-SMTP-SSL-1.04
Already downloaded: /Users/didi/Library/Caches/Homebrew/downloads/0726c68dac390b617cefcc880f076b50795463c1fba286d46a53082ebed2bc9d–Net-SMTP-SSL-1.04.tar.gz
==> Downloading https://www.kernel.org/pub/software/scm/git/git-2.26.0.tar.xz
Already downloaded: /Users/didi/Library/Caches/Homebrew/downloads/7ffeebae3fe34a52e488122b78c9b90326530eea782747bd112c17ba842583a5–git-2.26.0.tar.xz
Warning: A newer Command Line Tools release is available.
Update them from Software Update in the App Store or run:
softwareupdate –all –install –force



If that doesn’t show you an update run:
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select –install



Alternatively, manually download them from:
https://developer.apple.com/download/more/.



==> Installing dependencies for git: gettext and pcre2
==> Installing git dependency: gettext
Warning: A newer Command Line Tools release is available.
Update them from Software Update in the App Store or run:
softwareupdate –all –install –force



If that doesn’t show you an update run:
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select –install



Alternatively, manually download them from:
https://developer.apple.com/download/more/.



Error: An exception occurred within a child process:
NoMethodError: undefined method `source’ for nil:NilClass
fatal: ‘/Users/didi/brew/repository/homebrew-core’ does not appear to be a git repository
fatal: Could not read from remote repository.



Please make sure you have the correct access rights
and the repository exists.
fatal: ‘/Users/didi/brew/repository/homebrew-cask’ does not appear to be a git repository
fatal: Could not read from remote repository.



Please make sure you have the correct access rights
and the repository exists.
git: ‘credential-osxkeychain’ is not a git command. See ‘git –help’.
fatal: could not read Username for ‘https://github.com’: terminal prompts disabled
git: ‘credential-osxkeychain’ is not a git command. See ‘git –help’.
fatal: could not read Username for ‘https://github.com’: terminal prompts disabled
Error: Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core failed!
Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask failed!
Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-versions failed!
Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-dupes failed!



$echo “$(brew –repo)”
/usr/local/Homebrew



待指令执行结束,homebrew 也就修复好了。



$brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don’t worry or file an issue; just ignore this. Thanks!



Warning: Suspicious https://github.com/Homebrew/brew git origin remote found.
The current git origin is:
https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git



With a non-standard origin, Homebrew won’t update properly.
You can solve this by setting the origin remote:
git -C “/usr/local/Homebrew” remote set-url origin https://github.com/Homebrew/brew



Warning: A newer Command Line Tools release is available.
Update them from Software Update in the App Store or run:
softwareupdate –all –install –force



If that doesn’t show you an update run:
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select –install



Alternatively, manually download them from:
https://developer.apple.com/download/more/.



Warning: Suspicious https://github.com/Homebrew/homebrew-core git origin remote found.
The current git origin is:
/Users/didi/brew/repository/homebrew-core



With a non-standard origin, Homebrew won’t update properly.
You can solve this by setting the origin remote:
git -C “/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core” remote set-url origin https://github.com/Homebrew/homebrew-core



Warning: You have the following deprecated, official taps tapped:
Homebrew/homebrew-dupes
Homebrew/homebrew-nginx
Homebrew/homebrew-science
Homebrew/homebrew-versions
Untap them with brew untap.



Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn’t put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.



Unexpected dylibs:
/usr/local/lib/libboost_atomic.dylib
/usr/local/lib/libboost_context.dylib
/usr/local/lib/libboost_locale.dylib
/usr/local/lib/libboost_numpy.dylib
/usr/local/lib/libboost_python.dylib
/usr/local/lib/libboost_thread.dylib
/usr/local/lib/libboost_wave.dylib
/usr/local/lib/libevent-2.2.1.dylib
/usr/local/lib/libevent_core-2.2.1.dylib
/usr/local/lib/libevent_extra-2.2.1.dylib
/usr/local/lib/libevent_pthreads-2.2.1.dylib
/usr/local/lib/libzmq.3.dylib



Warning: Unbrewed header files were found in /usr/local/include.
If you didn’t put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.



Unexpected header files:
/usr/local/include/evdns.h
/usr/local/include/event.h
/usr/local/include/evhttp.h
/usr/local/include/evrpc.h
/usr/local/include/evutil.h
/usr/local/include/php/TSRM/TSRM.h
/usr/local/include/php/TSRM/readdir.h
/usr/local/include/php/TSRM/tsrm_config.h
/usr/local/include/php/TSRM/tsrm_config.w32.h
/usr/local/include/php/TSRM/tsrm_config_common.h
/usr/local/include/php/TSRM/tsrm_nw.h
/usr/local/include/php/TSRM/tsrm_strtok_r.h
/usr/local/include/php/TSRM/tsrm_win32.h
/usr/local/include/php/Zend/zend.h
/usr/local/include/php/Zend/zend_API.h
/usr/local/include/php/Zend/zend_alloc.h
/usr/local/include/php/Zend/zend_alloc_sizes.h
/usr/local/include/php/Zend/zend_arena.h
/usr/local/include/php/Zend/zend_ast.h
/usr/local/include/php/Zend/zend_bitset.h
/usr/local/include/php/Zend/zend_build.h
/usr/local/include/php/Zend/zend_builtin_functions.h
/usr/local/include/php/Zend/zend_closures.h
/usr/local/include/php/Zend/zend_compile.h
/usr/local/include/php/Zend/zend_config.h
/usr/local/include/php/Zend/zend_config.nw.h
/usr/local/include/php/Zend/zend_config.w32.h
/usr/local/include/php/Zend/zend_constants.h
/usr/local/include/php/Zend/zend_dtrace.h
/usr/local/include/php/Zend/zend_errors.h
/usr/local/include/php/Zend/zend_exceptions.h
/usr/local/include/php/Zend/zend_execute.h
/usr/local/include/php/Zend/zend_extensions.h
/usr/local/include/php/Zend/zend_float.h
/usr/local/include/php/Zend/zend_gc.h
/usr/local/include/php/Zend/zend_generators.h
/usr/local/include/php/Zend/zend_globals.h
/usr/local/include/php/Zend/zend_globals_macros.h
/usr/local/include/php/Zend/zend_hash.h
/usr/local/include/php/Zend/zend_highlight.h
/usr/local/include/php/Zend/zend_inheritance.h
/usr/local/include/php/Zend/zend_ini.h
/usr/local/include/php/Zend/zend_ini_parser.h
/usr/local/include/php/Zend/zend_ini_scanner.h
/usr/local/include/php/Zend/zend_ini_scanner_defs.h
/usr/local/include/php/Zend/zend_interfaces.h
/usr/local/include/php/Zend/zend_istdiostream.h
/usr/local/include/php/Zend/zend_iterators.h
/usr/local/include/php/Zend/zend_language_parser.h
/usr/local/include/php/Zend/zend_language_scanner.h
/usr/local/include/php/Zend/zend_language_scanner_defs.h
/usr/local/include/php/Zend/zend_list.h
/usr/local/include/php/Zend/zend_llist.h
/usr/local/include/php/Zend/zend_long.h
/usr/local/include/php/Zend/zend_modules.h
/usr/local/include/php/Zend/zend_multibyte.h
/usr/local/include/php/Zend/zend_multiply.h
/usr/local/include/php/Zend/zend_object_handlers.h
/usr/local/include/php/Zend/zend_objects.h
/usr/local/include/php/Zend/zend_objects_API.h
/usr/local/include/php/Zend/zend_operators.h
/usr/local/include/php/Zend/zend_portability.h
/usr/local/include/php/Zend/zend_ptr_stack.h
/usr/local/include/php/Zend/zend_range_check.h
/usr/local/include/php/Zend/zend_signal.h
/usr/local/include/php/Zend/zend_smart_str.h
/usr/local/include/php/Zend/zend_smart_str_public.h
/usr/local/include/php/Zend/zend_sort.h
/usr/local/include/php/Zend/zend_stack.h
/usr/local/include/php/Zend/zend_stream.h
/usr/local/include/php/Zend/zend_string.h
/usr/local/include/php/Zend/zend_strtod.h
/usr/local/include/php/Zend/zend_strtod_int.h
/usr/local/include/php/Zend/zend_ts_hash.h
/usr/local/include/php/Zend/zend_type_info.h
/usr/local/include/php/Zend/zend_types.h
/usr/local/include/php/Zend/zend_variables.h
/usr/local/include/php/Zend/zend_virtual_cwd.h
/usr/local/include/php/Zend/zend_vm.h
/usr/local/include/php/Zend/zend_vm_def.h
/usr/local/include/php/Zend/zend_vm_execute.h
/usr/local/include/php/Zend/zend_vm_opcodes.h
/usr/local/include/php/ext/date/lib/timelib.h
/usr/local/include/php/ext/date/lib/timelib_config.h
/usr/local/include/php/ext/date/lib/timelib_structs.h
/usr/local/include/php/ext/date/php_date.h
/usr/local/include/php/ext/dom/xml_common.h
/usr/local/include/php/ext/filter/php_filter.h
/usr/local/include/php/ext/hash/php_hash.h
/usr/local/include/php/ext/hash/php_hash_adler32.h
/usr/local/include/php/ext/hash/php_hash_crc32.h
/usr/local/include/php/ext/hash/php_hash_fnv.h
/usr/local/include/php/ext/hash/php_hash_gost.h
/usr/local/include/php/ext/hash/php_hash_haval.h
/usr/local/include/php/ext/hash/php_hash_joaat.h
/usr/local/include/php/ext/hash/php_hash_md.h
/usr/local/include/php/ext/hash/php_hash_ripemd.h
/usr/local/include/php/ext/hash/php_hash_sha.h
/usr/local/include/php/ext/hash/php_hash_sha3.h
/usr/local/include/php/ext/hash/php_hash_snefru.h
/usr/local/include/php/ext/hash/php_hash_tiger.h
/usr/local/include/php/ext/hash/php_hash_whirlpool.h
/usr/local/include/php/ext/iconv/php_have_bsd_iconv.h
/usr/local/include/php/ext/iconv/php_have_glibc_iconv.h
/usr/local/include/php/ext/iconv/php_have_ibm_iconv.h
/usr/local/include/php/ext/iconv/php_have_iconv.h
/usr/local/include/php/ext/iconv/php_have_libiconv.h
/usr/local/include/php/ext/iconv/php_iconv.h
/usr/local/include/php/ext/iconv/php_iconv_aliased_libiconv.h
/usr/local/include/php/ext/iconv/php_iconv_broken_ignore.h
/usr/local/include/php/ext/iconv/php_iconv_supports_errno.h
/usr/local/include/php/ext/iconv/php_php_iconv_h_path.h
/usr/local/include/php/ext/iconv/php_php_iconv_impl.h
/usr/local/include/php/ext/json/php_json.h
/usr/local/include/php/ext/json/php_json_parser.h
/usr/local/include/php/ext/json/php_json_scanner.h
/usr/local/include/php/ext/libxml/php_libxml.h
/usr/local/include/php/ext/pcre/pcrelib/config.h
/usr/local/include/php/ext/pcre/pcrelib/pcre.h
/usr/local/include/php/ext/pcre/pcrelib/pcre_internal.h
/usr/local/include/php/ext/pcre/pcrelib/pcreposix.h
/usr/local/include/php/ext/pcre/pcrelib/ucp.h
/usr/local/include/php/ext/pcre/php_pcre.h
/usr/local/include/php/ext/pdo/php_pdo.h
/usr/local/include/php/ext/pdo/php_pdo_driver.h
/usr/local/include/php/ext/pdo/php_pdo_error.h
/usr/local/include/php/ext/phar/php_phar.h
/usr/local/include/php/ext/session/mod_files.h
/usr/local/include/php/ext/session/mod_user.h
/usr/local/include/php/ext/session/php_session.h
/usr/local/include/php/ext/simplexml/php_simplexml.h
/usr/local/include/php/ext/simplexml/php_simplexml_exports.h
/usr/local/include/php/ext/spl/php_spl.h
/usr/local/include/php/ext/spl/spl_array.h
/usr/local/include/php/ext/spl/spl_directory.h
/usr/local/include/php/ext/spl/spl_dllist.h
/usr/local/include/php/ext/spl/spl_engine.h
/usr/local/include/php/ext/spl/spl_exceptions.h
/usr/local/include/php/ext/spl/spl_fixedarray.h
/usr/local/include/php/ext/spl/spl_functions.h
/usr/local/include/php/ext/spl/spl_heap.h
/usr/local/include/php/ext/spl/spl_iterators.h
/usr/local/include/php/ext/spl/spl_observer.h
/usr/local/include/php/ext/sqlite3/libsqlite/sqlite3.h
/usr/local/include/php/ext/standard/base64.h
/usr/local/include/php/ext/standard/basic_functions.h
/usr/local/include/php/ext/standard/crc32.h
/usr/local/include/php/ext/standard/credits.h
/usr/local/include/php/ext/standard/credits_ext.h
/usr/local/include/php/ext/standard/credits_sapi.h
/usr/local/include/php/ext/standard/crypt_blowfish.h
/usr/local/include/php/ext/standard/crypt_freesec.h
/usr/local/include/php/ext/standard/css.h
/usr/local/include/php/ext/standard/cyr_convert.h
/usr/local/include/php/ext/standard/datetime.h
/usr/local/include/php/ext/standard/dl.h
/usr/local/include/php/ext/standard/exec.h
/usr/local/include/php/ext/standard/file.h
/usr/local/include/php/ext/standard/flock_compat.h
/usr/local/include/php/ext/standard/fsock.h
/usr/local/include/php/ext/standard/head.h
/usr/local/include/php/ext/standard/html.h
/usr/local/include/php/ext/standard/html_tables.h
/usr/local/include/php/ext/standard/info.h
/usr/local/include/php/ext/standard/md5.h
/usr/local/include/php/ext/standard/microtime.h
/usr/local/include/php/ext/standard/pack.h
/usr/local/include/php/ext/standard/pageinfo.h
/usr/local/include/php/ext/standard/php_array.h
/usr/local/include/php/ext/standard/php_assert.h
/usr/local/include/php/ext/standard/php_browscap.h
/usr/local/include/php/ext/standard/php_crypt.h
/usr/local/include/php/ext/standard/php_crypt_r.h
/usr/local/include/php/ext/standard/php_dir.h
/usr/local/include/php/ext/standard/php_dns.h
/usr/local/include/php/ext/standard/php_ext_syslog.h
/usr/local/include/php/ext/standard/php_filestat.h
/usr/local/include/php/ext/standard/php_fopen_wrappers.h
/usr/local/include/php/ext/standard/php_ftok.h
/usr/local/include/php/ext/standard/php_http.h
/usr/local/include/php/ext/standard/php_image.h
/usr/local/include/php/ext/standard/php_incomplete_class.h
/usr/local/include/php/ext/standard/php_iptc.h
/usr/local/include/php/ext/standard/php_lcg.h
/usr/local/include/php/ext/standard/php_link.h
/usr/local/include/php/ext/standard/php_mail.h
/usr/local/include/php/ext/standard/php_math.h
/usr/local/include/php/ext/standard/php_metaphone.h
/usr/local/include/php/ext/standard/php_mt_rand.h
/usr/local/include/php/ext/standard/php_password.h
/usr/local/include/php/ext/standard/php_rand.h
/usr/local/include/php/ext/standard/php_random.h
/usr/local/include/php/ext/standard/php_smart_string.h
/usr/local/include/php/ext/standard/php_smart_string_public.h
/usr/local/include/php/ext/standard/php_standard.h
/usr/local/include/php/ext/standard/php_string.h
/usr/local/include/php/ext/standard/php_type.h
/usr/local/include/php/ext/standard/php_uuencode.h
/usr/local/include/php/ext/standard/php_var.h
/usr/local/include/php/ext/standard/php_versioning.h
/usr/local/include/php/ext/standard/proc_open.h
/usr/local/include/php/ext/standard/quot_print.h
/usr/local/include/php/ext/standard/scanf.h
/usr/local/include/php/ext/standard/sha1.h
/usr/local/include/php/ext/standard/streamsfuncs.h
/usr/local/include/php/ext/standard/uniqid.h
/usr/local/include/php/ext/standard/url.h
/usr/local/include/php/ext/standard/url_scanner_ex.h
/usr/local/include/php/ext/standard/winver.h
/usr/local/include/php/ext/xml/expat_compat.h
/usr/local/include/php/ext/xml/php_xml.h
/usr/local/include/php/main/SAPI.h
/usr/local/include/php/main/build-defs.h
/usr/local/include/php/main/fastcgi.h
/usr/local/include/php/main/fopen_wrappers.h
/usr/local/include/php/main/http_status_codes.h
/usr/local/include/php/main/php.h
/usr/local/include/php/main/php_compat.h
/usr/local/include/php/main/php_config.h
/usr/local/include/php/main/php_content_types.h
/usr/local/include/php/main/php_getopt.h
/usr/local/include/php/main/php_globals.h
/usr/local/include/php/main/php_ini.h
/usr/local/include/php/main/php_main.h
/usr/local/include/php/main/php_memory_streams.h
/usr/local/include/php/main/php_network.h
/usr/local/include/php/main/php_open_temporary_file.h
/usr/local/include/php/main/php_output.h
/usr/local/include/php/main/php_reentrancy.h
/usr/local/include/php/main/php_scandir.h
/usr/local/include/php/main/php_stdint.h
/usr/local/include/php/main/php_streams.h
/usr/local/include/php/main/php_syslog.h
/usr/local/include/php/main/php_ticks.h
/usr/local/include/php/main/php_variables.h
/usr/local/include/php/main/php_version.h
/usr/local/include/php/main/rfc1867.h
/usr/local/include/php/main/snprintf.h
/usr/local/include/php/main/spprintf.h
/usr/local/include/php/main/streams/php_stream_context.h
/usr/local/include/php/main/streams/php_stream_filter_api.h
/usr/local/include/php/main/streams/php_stream_glob_wrapper.h
/usr/local/include/php/main/streams/php_stream_mmap.h
/usr/local/include/php/main/streams/php_stream_plain_wrapper.h
/usr/local/include/php/main/streams/php_stream_transport.h
/usr/local/include/php/main/streams/php_stream_userspace.h
/usr/local/include/php/main/streams/php_streams_int.h
/usr/local/include/php/main/win95nt.h
/usr/local/include/php/sapi/cli/cli.h



Warning: Unbrewed .la files were found in /usr/local/lib.
If you didn’t put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.



Unexpected .la files:
/usr/local/lib/libevent.la
/usr/local/lib/libevent_core.la
/usr/local/lib/libevent_extra.la
/usr/local/lib/libevent_pthreads.la



Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn’t put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.



Unexpected .pc files:
/usr/local/lib/pkgconfig/libevent.pc
/usr/local/lib/pkgconfig/libevent_core.pc
/usr/local/lib/pkgconfig/libevent_extra.pc
/usr/local/lib/pkgconfig/libevent_pthreads.pc



Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn’t put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.



Unexpected static libraries:
/usr/local/lib/libboost_atomic.a
/usr/local/lib/libboost_context.a
/usr/local/lib/libboost_locale.a
/usr/local/lib/libboost_numpy.a
/usr/local/lib/libboost_python.a
/usr/local/lib/libboost_thread.a
/usr/local/lib/libboost_wave.a
/usr/local/lib/libevent.a
/usr/local/lib/libevent_core.a
/usr/local/lib/libevent_extra.a
/usr/local/lib/libevent_pthreads.a



Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run brew link on these:
elasticsearch
mysql



Warning: You are using macOS 10.11.
We (and Apple) do not provide support for this old version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew’s GitHub,
Discourse, Twitter or IRC. You are responsible for resolving any issues you
experience while you are running this old version.



Warning: An outdated version (2.8.1) of Git was detected in your PATH.
Git 2.14.3 or newer is required for Homebrew.
Please upgrade:
brew install git



Warning: Some installed formulae are missing dependencies.
You should brew install the missing dependencies:
brew install openssl@1.1 protobuf



Run brew missing for more details.



$ brew update
Warning: You are using macOS 10.11.
We (and Apple) do not provide support for this old version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew’s GitHub,
Discourse, Twitter or IRC. You are responsible for resolving any issues you
experience while you are running this old version.



==> Downloading https://ftp.gnu.org/gnu/gettext/gettext-0.20.1.tar.xz
Already downloaded: /Users/didi/Library/Caches/Homebrew/downloads/ae9054eb313c4bc212a180985b803835865e320d827a3e0f677a9f89ea251d24–gettext-0.20.1.tar.xz
==> Downloading https://ftp.pcre.org/pub/pcre/pcre2-10.34.tar.bz2
Already downloaded: /Users/didi/Library/Caches/Homebrew/downloads/b08f20d116fa04589856a1913eceff5c7566b1288a0b0cad3864ba023258f360–pcre2-10.34.tar.bz2
==> Downloading https://www.kernel.org/pub/software/scm/git/git-htmldocs-2.26.0.tar.xz
Already downloaded: /Users/didi/Library/Caches/Homebrew/downloads/5d57293cbd0867bd9875f536894145ddb5ce50eb16d0448fbe91c730c30a0147–git-htmldocs-2.26.0.tar.xz
==> Downloading https://www.kernel.org/pub/software/scm/git/git-manpages-2.26.0.tar.xz
Already downloaded: /Users/didi/Library/Caches/Homebrew/downloads/803896fd35e4697f679a2b36981119348c37a5a4c2a6894bf6e20b06099c1780–git-manpages-2.26.0.tar.xz
==> Downloading https://cpan.metacpan.org/authors/id/R/RJ/RJBS/Net-SMTP-SSL-1.04.tar.gz
Already downloaded: /Users/didi/Library/Caches/Homebrew/downloads/0726c68dac390b617cefcc880f076b50795463c1fba286d46a53082ebed2bc9d–Net-SMTP-SSL-1.04.tar.gz
==> Downloading https://www.kernel.org/pub/software/scm/git/git-2.26.0.tar.xz
Already downloaded: /Users/didi/Library/Caches/Homebrew/downloads/7ffeebae3fe34a52e488122b78c9b90326530eea782747bd112c17ba842583a5–git-2.26.0.tar.xz
Warning: A newer Command Line Tools release is available.
Update them from Software Update in the App Store or run:
softwareupdate –all –install –force



If that doesn’t show you an update run:
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select –install



Alternatively, manually download them from:
https://developer.apple.com/download/more/.



==> Installing dependencies for git: gettext and pcre2
==> Installing git dependency: gettext
Warning: A newer Command Line Tools release is available.
Update them from Software Update in the App Store or run:
softwareupdate –all –install –force



If that doesn’t show you an update run:
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select –install



Alternatively, manually download them from:
https://developer.apple.com/download/more/.



Error: An exception occurred within a child process:
NoMethodError: undefined method `source’ for nil:NilClass
fatal: ‘/Users/didi/brew/repository/homebrew-core’ does not appear to be a git repository
fatal: Could not read from remote repository.



Please make sure you have the correct access rights
and the repository exists.
fatal: ‘/Users/didi/brew/repository/homebrew-cask’ does not appear to be a git repository
fatal: Could not read from remote repository.



Please make sure you have the correct access rights
and the repository exists.
git: ‘credential-osxkeychain’ is not a git command. See ‘git –help’.
fatal: could not read Username for ‘https://github.com’: terminal prompts disabled
git: ‘credential-osxkeychain’ is not a git command. See ‘git –help’.
fatal: could not read Username for ‘https://github.com’: terminal prompts disabled
Error: Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core failed!
Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask failed!
homebrew/homebrew-versions does not exist! Run brew untap homebrew/homebrew-versions to remove it.
homebrew/homebrew-dupes does not exist! Run brew untap homebrew/homebrew-dupes to remove it.



以前改过



cd /usr/local/Homebrew/
git remote set-url origin /Users/didi/brew/repository/brew



cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
git remote set-url origin /Users/didi/brew/repository/homebrew-core



cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask
git remote set-url origin /Users/didi/brew/repository/homebrew-cask



改回来



在国内的网络环境下使用 Homebrew 安装软件的过程中,可能会长时间卡在 Updating Homebrew …



方法一:按command + c 取消本次更新操作,直接安装软件



方法二:设置国内镜像



1.替换 brew.git 仓库地址



阿里巴巴的 brew.git 仓库地址:


cd “$(brew –repo)”
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git



中国科学技术大学的 brew.git 仓库地址


cd “$(brew –repo)”
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git



2.替换 homebrew-core.git 仓库地址



替换成阿里巴巴的 homebrew-core.git 仓库地址:


cd “$(brew –repo)/Library/Taps/homebrew/homebrew-core”
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git



替换中国科学技术大学的 homebrew-core.git 仓库地址:


cd “$(brew –repo)/Library/Taps/homebrew/homebrew-core”
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git



3.替换 homebrew-cask.git 仓库地址



中国科学技术大学的 homebrew-cask 仓库地址:


cd “$(brew –repo)/Library/Taps/homebrew/homebrew-cask”
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git



4.替换 homebrew-bottles 访问地址



替换阿里巴巴的 homebrew-bottles 访问 URL:


echo ‘export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles’ » ~/.bash_profile



替换中国科学技术大学的 homebrew-bottles 访问 URL:


echo ‘export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles’ » ~/.bash_profile



source ~/.bash_profile



还原:



还原为官方提供的 brew.git 仓库地址


cd “$(brew –repo)”
git remote set-url origin https://github.com/Homebrew/brew.git



还原为官方提供的 homebrew-core.git 仓库地址


cd “$(brew –repo)/Library/Taps/homebrew/homebrew-core”
git remote set-url origin https://github.com/Homebrew/homebrew-core.git



还原为官方提供的 homebrew-cask.git 仓库地址


cd “$(brew –repo)/Library/Taps/homebrew/homebrew-cask”
git remote set-url origin https://github.com/Homebrew/homebrew-cask.git



还原为官方提供的 homebrew-bottles 访问地址


vi ~/.bash_profile


然后,删除 HOMEBREW_BOTTLE_DOMAIN 这一行配置


source ~/.bash_profile



https://www.cnblogs.com/huangzs/p/11717937.html
cd “$(brew –repo)”
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
cd “$(brew –repo)/Library/Taps/homebrew/homebrew-core”
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
cd “$(brew –repo)/Library/Taps/homebrew/homebrew-cask”
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git



$rvm install 2.2.0 –disable-binary
Checking requirements for osx.
Installing requirements for osx.
Updating system……



. …..Failed to update Homebrew, follow instructions at



https://docs.brew.sh/Common-Issues


and make sure brew update works before continuing.
.
Error running ‘requirements_osx_brew_update_system ruby-2.2.0’,
please read /Users/didi/.rvm/log/1590044029_ruby-2.2.0/update_system.log
Requirements installation failed with status: 1.



$brew missing
mysql: openssl@1.1 protobuf



brew install openssl@1.1 protobuf



Update them from Software Update in the App Store or run:
softwareupdate –all –install –force



If that doesn’t show you an update run:
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select –install



$curl -sSL https://get.rvm.io | bash -s stable –ruby
curl: (7) Failed to connect to api.github.com port 443: Connection refused
WARN: …the preceeding error with code 7 occurred while fetching https://api.github.com/repos/rvm/rvm/tags
Downloading https://github.com/rvm/rvm/archive/1.29.9.tar.gz



Category web