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