简体   繁体   English

在 Mac 上安装 Homebrew 时出现错误

[英]I got error when install Homebrew on Mac

I ran bellow command according to the instruction on the site.我根据网站上的说明运行了以下命令。 But I got this error.但是我得到了这个错误。

site: https://brew.sh/网址: https://brew.sh/

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
curl: (1) Protocol https not supported or disabled in libcurl
-bash: $: command not found

I investigated to enable SSL on curl, but I couldn't find the resolution on my environment.我调查了在 curl 上启用 SSL,但我无法在我的环境中找到解决方案。 So I accessed https://raw.githubusercontent.com/Homebrew/install/master/install by browser and downloaded to local and ran it.于是我用浏览器访问https://raw.githubusercontent.com/Homebrew/install/master/install下载到本地运行。 But I got this error.但是我得到了这个错误。

$ /usr/bin/ruby -e "$(/Users/tadashingo/Documents/install)"
-bash: /Users/tadashingo/Documents/install: Permission denied

I tried this workaround, but I still got the error.我尝试了此解决方法,但仍然出现错误。 warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777 警告:PATH 中的不安全世界可写目录 /usr/local/bin,模式 040777

Could you please guide me to install Homebrew on my environment?你能指导我在我的环境中安装 Homebrew 吗?

Resolved. 解决。

I changed the name from "install" to "install.rb2", go to the directory and ran it. 我将名称从“ install”更改为“ install.rb2”,转到目录并运行它。

$ /usr/bin/ruby install.rb

The warning about insecure directory /usr/local/bin can be solved by running 有关不安全目录/usr/local/bin的警告可以通过运行来解决

sudo chown o-w /usr/local/bin

You get the error about permission denied running install because you invoke it the wrong way. 您收到有关权限被拒绝运行install的错误,因为您以错误的方式调用它。

Run it as: 运行为:

$ ruby /Users/tadashingo/Documents/install

and it will work. 它会工作。

After a recent pull request, this is the new installation command for HomeBrew.在最近的拉取请求之后,这是 HomeBrew 的新安装命令。

/bin/bash -c "$(curl -fsSLhttps://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM