Mac 升级到10.12 出现的各种问题解决

[TOC]

基础编译无法工作

xcode-select --install

不显示允许任何来源 –安装文件下载损坏问题

表现为
下载文件损坏,和不显示允许任何来源,图片解锁和应用程序问题(如图片/application应用程序损坏,文件不能打开)
解决方法

sudo spctl --master-disable

禁用Gatekeeper检查
然后再安全与隐私中勾选 任何来源

ruby 环境

brew install ruby-install
# 安装指定 Ruby 版本
ruby-install ruby 2.2.3

管理版本

brew install chruby
chruby ruby-2.2.3

如果需要切换,在 .bashrc 或者 .bash_profile 里加入脚本(具体路径最好照官方说明来)
第一个脚本加载 chruby ,第二个脚本控制自动切换(按 .ruby-version 文件)

source /usr/local/opt/chruby/share/chruby/chruby.sh
source /usr/local/opt/chruby/share/chruby/auto.sh

chruby 会从当前目录向上一层层地找 .ruby-version 文件,所以你只要把默认 Ruby 版本写在 ~/.ruby-version 里就可以了,以此类推,在任何目录下都能切换到想要的版本

检查ruby安装结果

ruby -v
gem -v

配置镜像
https://ruby.taobao.org/

gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org
gem sources -l

brew 无法正常工作

需要手动卸载再安装brew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

更多情况请通过这个 http://brew.sh/ 查看对应解决方法

升级一般导致各种不能使用 补充安装列表

brew install zsh
brew install mercurial
brew install vim
brew install tree
brew install autojump
brew install lrzsz
brew install dos2unix
brew install cmake
brew install pypy
brew install python3
brew install chruby
brew install nginx
brew install golang
brew install syncthing
brew install binutils
  • DataBase
brew install redis
brew install mongodb
  • markdown
brew install pandoc
brew tap phinze/cask
brew install brew-cask
brew cask install mactex
  • RN
brew install watchman
brew install flow
brew install yarn
  • Scala
brew install scala
  • node brew 安装问题
brew cleanup node
brew link node
brew uninstall node
brew install node
  • auto test
brew install chromedriver

port 无法正常工作

这个是很正常的,会报告错误

Error: Current platform "darwin 16" does not match expected platform "darwin 15"
Error: If you upgraded your OS, please follow the migration instructions: https://trac.macports.org/wiki/Migration
OS platform mismatch
    while executing
"mportinit ui_options global_options global_variations"
Error: /opt/local/bin/port: Failed to initialize MacPorts, OS platform mismatch

你需要去这里 https://www.macports.org/install.php 重新下载对应系统的macport
建议升级macport后执行这3个命令

# 更新port信息
sudo port -v selfupdate
# 查看可更新的软件信息
sudo port info outdated
# 更新这些软件
sudo port upgrade outdated

你可能感兴趣的:(Mac 升级到10.12 出现的各种问题解决)