ERROR: '/usr/local/bin' is not writable - it is required for Homebrew, try 'brew doctor' to fix it!

今天看环信的SDK 偶然间看到cocopods这个好东西,作为程序员怎么能不入手学习,于是按照教程一步步安装ruby 等
在这一步卡主 报错如下

No binary rubies available for: osx/10.10/x86_64/ruby-2.0.0-p643.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
ERROR: '/usr/local/bin' is not writable - it is required for Homebrew, try 'brew doctor' to fix it!
Requirements installation failed with status: 1.

查询到可能原因是 因Mac未安装Homebrew造成的
于是又去安装Homebrew

终端命令:

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

回车后反馈如下:

It appears Homebrew is already installed. If your intent is to reinstall you
should do the following before running this installer again:
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
The current contents of /usr/local are bin Cellar CODEOFCONDUCT.md CONTRIBUTING.md etc include lib Library LICENSE.txt opt README.md share SUPPORTERS.md .git .gitignore

提示的信息表示,已经安装好了,如果你想要删掉 就键入如下代码巴拉巴拉“`

并且我再次键入 $rvm install ruby-2.0.0-p643
依旧报错

ERROR: '/usr/local/bin' is not writable - it is required for Homebrew, try 'brew doctor' to fix it!
Requirements installation failed with status: 1.

得了,好好仔细看看报错内容吧 not writable 不可写入, 是不是安装不上啊 然后百度到一条老外也出一样的错误 他是这么解决的
终端命令:

 $ rvm autolibs read-only # read more here:https://rvm.io/rvm/autolibs

 $ rvm install ruby

尼玛,然后终端就疯狂的开始下载了

Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.10/x86_64/ruby-2.2.1.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Skipping update of certificates in '/usr/local/etc/openssl/cert.pem', to force update run:
    rvm osx-ssl-certs update /usr/local/etc/openssl/cert.pem

Requirements installation successful.
Installing Ruby from source to: /Users/Aotu/.rvm/rubies/ruby-2.2.1, this may take a while depending on your cpu(s)...
ruby-2.2.1 - #downloading ruby-2.2.1, this may take a while depending on your connection...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 12.7M  100 12.7M    0     0   242k      0  0:00:53  0:00:53 --:--:--  230k
ruby-2.2.1 - #extracting ruby-2.2.1 to /Users/Aotu/.rvm/src/ruby-2.2.1....
ruby-2.2.1 - #applying patch /Users/Aotu/.rvm/patches/ruby/2.2.1/fix_installing_bundled_gems.patch.
ruby-2.2.1 - #configuring..........................................................
ruby-2.2.1 - #post-configuration.
ruby-2.2.1 - #compiling............................................................................................|
ruby-2.2.1 - #installing..........
ruby-2.2.1 - #making binaries executable..
ruby-2.2.1 - #downloading rubygems-2.4.8
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   154  100   154    0     0     46      0  0:00:03  0:00:03 --:--:--   129
100  437k  100  437k    0     0  74299      0  0:00:06  0:00:06 --:--:--  198k
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.2.1 - #extracting rubygems-2.4.8....
ruby-2.2.1 - #removing old rubygems.........
ruby-2.2.1 - #installing rubygems-2.4.8......................
ruby-2.2.1 - #gemset created /Users/Aotu/.rvm/gems/ruby-2.2.1@global
ruby-2.2.1 - #importing gemset /Users/Aotu/.rvm/gemsets/global.gems................................................
ruby-2.2.1 - #generating global wrappers........
ruby-2.2.1 - #gemset created /Users/Aotu/.rvm/gems/ruby-2.2.1
ruby-2.2.1 - #importing gemsetfile /Users/Aotu/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.2.1 - #generating default wrappers........
ruby-2.2.1 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.2.1 - #complete 
Ruby was built without documentation, to build it run: rvm docs generate-ri

到此,ruby就安装好了 而且我们注意看到 ruby的安装版本并不是2.0.0
而是2.2.1

事情并没有这么就结束,我回头再看报错的提示信息

ERROR: '/usr/local/bin' is not writable - it is required for Homebrew, try 'brew doctor' to fix it!
Requirements installation failed with status: 1.

当然 首先把安装好的2.2.1删掉 防止有哪些影响
rvm remove 2.2.1

ruby-2.2.1 - #removing src/ruby-2.2.1..
ruby-2.2.1 - #removing rubies/ruby-2.2.1..
ruby-2.2.1 - #removing gems....
ruby-2.2.1 - #removing aliases
ruby-2.2.1 - #removing wrappers....
ruby-2.2.1 - #removing environments....

这里有个 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 and just ignore them. Thanks!

Warning: /usr/local/bin isn't writable.

This can happen if you "sudo make install" software that isn't managed by
by Homebrew. If a formula tries to write a file to this directory, the
install will fail during the link step.

You should probably `chown` /usr/local/bin

Warning: /usr/local/Cellar isn't writable.
You should `chown` /usr/local/Cellar

Warning: /usr/local/etc isn't writable.

This can happen if you "sudo make install" software that isn't managed by
by Homebrew. If a formula tries to write a file to this directory, the
install will fail during the link step.

You should probably `chown` /usr/local/etc

Warning: /usr/local/include isn't writable.

This can happen if you "sudo make install" software that isn't managed by
by Homebrew. If a formula tries to write a file to this directory, the
install will fail during the link step.

You should probably `chown` /usr/local/include

Warning: /usr/local/lib isn't writable.

This can happen if you "sudo make install" software that isn't managed by
by Homebrew. If a formula tries to write a file to this directory, the
install will fail during the link step.

You should probably `chown` /usr/local/lib

Warning: /usr/local/lib/pkgconfig isn't writable.

This can happen if you "sudo make install" software that isn't managed by
by Homebrew. If a formula tries to write a file to this directory, the
install will fail during the link step.

You should probably `chown` /usr/local/lib/pkgconfig

Warning: /usr/local/opt isn't writable.
You should `chown` /usr/local/opt

Warning: /usr/local/share isn't writable.

This can happen if you "sudo make install" software that isn't managed by
by Homebrew. If a formula tries to write a file to this directory, the
install will fail during the link step.

You should probably `chown` /usr/local/share

Warning: Some directories in /usr/local/share/man aren't writable.
This can happen if you "sudo make install" software that isn't managed
by Homebrew. If a brew tries to add locale information to one of these
directories, then the install will fail during the link step.
You should probably `chown` them:

    /usr/local/share/man
    /usr/local/share/man/man1

Warning: Your Homebrew is outdated.
You haven't updated for at least 24 hours. This is a long time in brewland!
To update Homebrew, run `brew update`.

在这一坨警告文档里 第一个就看到了我们的错误详解
Warning: /usr/local/bin isn’t writable.

This can happen if you “sudo make install” software that isn’t managed by
by Homebrew. If a formula tries to write a file to this directory, the
install will fail during the link step.

总之就是告诉你 问题还是处在 Homebrew 上面,
然而问题还是存在

总结:


1.遇到这个报错 ,试试先安装下 Homebrew 试试看,
如果已经安装过了,可以卸载一下重新安装,


2 . 如果 rvm install 2.0.0 没有用,
可以用这段命令代替,好像可以自动安装最新版本的ruby

 $ rvm autolibs read-only # read more here:https://rvm.io/rvm/autolibs

 $ rvm install ruby

3.问题暂时先记录在这里,留以后再来翻阅

如果在安装ffmpeg时出现了`Error: No such keg: /opt/homebrew/Cellar/ffmpeg`的错误提示,这可能是由于Homebrew的安装路径不同或者ffmpeg未正确安装导致的。 请尝试以下解决方案: 1. 检查Homebrew安装路径:确认你的Homebrew安装路径是否与错误提示中的路径一致。默认情况下,Homebrew的安装路径为`/usr/local/Homebrew`。你可以在终端中运行以下命令来检查Homebrew的安装路径: ```shell brew --prefix ``` 如果输出的路径不是`/usr/local/Homebrew`,请将以下命令添加到你的shell配置文件(例如`.bash_profile`、`.zshrc`等)中,将Homebrew的安装路径设置为正确的路径: ```shell export HOMEBREW_PREFIX=/path/to/homebrew export PATH=$HOMEBREW_PREFIX/bin:$PATH ``` 将`/path/to/homebrew`替换为你实际的Homebrew安装路径。然后保存文件,并重新启动终端。 2. 检查ffmpeg安装状态:确认你是否已经正确安装了ffmpeg。你可以在终端中运行以下命令来检查ffmpeg的安装状态: ```shell brew list ffmpeg ``` 如果没有任何输出或者输出为空,说明ffmpeg尚未安装。你可以使用以下命令来安装ffmpeg: ```shell brew install ffmpeg ``` 如果已经安装了ffmpeg,但仍然出现错误,请尝试重新安装ffmpeg: ```shell brew reinstall ffmpeg ``` 如果上述方法仍然无法解决问题,请检查你的系统和Homebrew的安装过程是否存在其他问题。你也可以尝试在Homebrew的官方网站上查找更多关于安装和配置的信息,或者寻求相关支持。
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值