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.问题暂时先记录在这里,留以后再来翻阅

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
### 回答1: 这个错误提示表明你的Java可执行文件没有权限执行。你可以通过以下步骤解决这个问题: 1. 确认Java环境已经正确安装,如果没有安装可以通过以下命令安装: ``` sudo apt-get update sudo apt-get install default-jdk ``` 2. 确认Java可执行文件的权限是否正确,可以通过以下命令修改权限: ``` sudo chmod +x /usr/local/src/hadoop-3.1.3/bin/java ``` 如果你不确定Java可执行文件的路径,可以通过以下命令查找: ``` sudo find / -name java -type f ``` 这个命令会查找整个文件系统中名为java的可执行文件。 3. 如果以上步骤都不起作用,可以尝试重新安装Java环境或者从其他渠道下载Java可执行文件替换原来的文件。 ### 回答2: 这个错误提示表示 `/usr/local/src/hadoop-3.1.3//bin/java` 这个路径下的 java 可执行文件不可执行。 解决方案可以是进行以下检查和操作: 1. 首先,确认该路径下是否存在 java 可执行文件。可以通过使用命令 `ls -l /usr/local/src/hadoop-3.1.3//bin/` 来查看该目录下的文件列表,确保 java 文件存在。 2. 确认该 java 文件的执行权限是否正确设置。可以使用 `ls -l /usr/local/src/hadoop-3.1.3//bin/java` 查看权限设置。正常情况下,可执行文件应该至少具有 `rwx` 的权限。 3. 如果执行权限不正确,可以使用 `chmod +x /usr/local/src/hadoop-3.1.3//bin/java` 命令来为该文件添加可执行权限。 4. 如果问题还未解决,请确认路径是否正确,特别是双斜杠 `//` 是否引起了问题。使用 `ls -l /usr/local/src/hadoop-3.1.3/bin/java` 来确认该路径是否正确。 5. 最后,如果上述解决方法无效,可能是由于其他原因导致无法执行 java 文件。可以考虑重新安装或更新 java 并确保正确设置环境变量。 请根据具体情况检查和尝试上述解决方案,以解决 `/usr/local/src/hadoop-3.1.3//bin/java is not executable` 的错误。 ### 回答3: 这个错误表示/usr/local/src/hadoop-3.1.3//bin/java文件不可执行。一般情况下,这种情况可能是因为该文件没有执行权限。 要解决这个问题,可以按照以下步骤操作: 1. 打开终端,进入hadoop安装目录下的bin文件夹。 2. 使用命令`ls -l`查看java文件的权限。如果文件没有执行权限,可以使用命令`chmod +x java`来赋予文件执行权限。 3. 再次使用命令`ls -l`确认java文件现在是否有执行权限。 4. 如果java文件现在有了执行权限,尝试重新运行你的程序。 如果以上步骤依然无法解决问题,可能还有其他原因导致文件不可执行。如果你确定该文件存在且位置正确,你可以尝试检查文件是否被破坏或损坏,或者尝试重新安装hadoop。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值