个人Mac使用homebrew管理,因而我使用brew install gdb
命令直接安装gdb,结果以下:
node
我在stackoverflow找到了发生的相似状况,通过阅读判断,找到了一下两种解决办法:app
命令内容:测试
sudo chown -R `whoami`:admin /usr/local/bin
homebrew doctor
进行检测,根据其反馈来进行操做:我认为应该使用第二中方法比较好,因而我在终端输入homebrew doctor
,稍做等待获得检测结果:
this
如划红线部分所示,与我遇到的问题相符合,运行其解决方案:
sudo chown -R $(whoami) /usr/local/bin
在此时再link一下个人GDB:
brew link gdb
结果以下:
Already linked: /usr/local/Cellar/gdb/8.0.1
再测试一下GDB:
gdb
结果以下:
成功..net
sudo make install
命令,致使了一些软件非homebrew管理,因此homebrew在Link的时候会出现问题。homebrew doctor
以下提示:This can happen if you "sudo make install" software that isn't managed by Homebrew. If a formula tries to write a file to this directory, the install will fail during the link step. You should change the ownership and permissions of these directories. back to your user account.
用brew安装node遇到的问题
Error: The 'brew link' step did not complete successfully
homebrew could not symlink usr/local/bin is not writablecode