Homebrew Permissions一团糟

时间:2013-09-18 03:07:26

标签: ruby permissions homebrew

我从我的管理员帐户安装了Homebrew。如果我从该帐户运行brew doctor我没有错误,但如果我从非管理员用户帐户运行brew doctor,我会收到有关多个目录(usr/local及其子目录)的警告可写,以及我chown他们的建议。

最近,我从非管理员帐户安装了RVM(以确保它对该用户可用并安装在他们的主目录中)。然后我运行rvm install 1.9.3(再次,作为非管理员)并收到错误警告我usr/local/bin不可写并且是Homebrew所必需的。运行rvm requirements会产生相同的警告。

我是否应该将RVM安装为非管理员,当我使用 RVM安装ruby版本时切换到管理员,然后能够使用RVM(除了安装之外的所有内容)管理员帐户?或者这里有什么不对吗?

我尝试安装1.9.3时的RVM输出如下:

$ rvm install 1.9.3
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.8/x86_64/ruby-1.9.3-p448.
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.

有人建议我以管理员身份登录时不应该安装Homebrew,所以我应该卸载(作为管理员),然后以普通用户身份重新安装。我试过这个,但是当我以普通用户身份运行安装脚本时,它首先告诉我的是:

$ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
This script requires the user myuser to be an Administrator. If this
sucks for you then you can install Homebrew in your home directory or however
you please; please refer to our homepage. If you still want to use this script
set your user to be an Administrator in System Preferences or `su' to a
non-root user with Administrator privileges.

我想这就是我首先以管理员身份安装它的原因。有什么帮助澄清这个吗?

1 个答案:

答案 0 :(得分:68)

我有同样的问题,我必须阅读文档并思考很多。

$ rvm autolibs read-only # read more here: https://rvm.io/rvm/autolibs
$ rvm install ruby  # or any version you want

这告诉rvm使用当前安装的libs安装ruby ...默认为read-fail,终止rvm以查找错过的需求。

要使用openssl(gem需要它,我必须重建ruby)。让计算机管理员用brew安装openssl

$ brew install openssl  # if you want to install all dependencies run 'rvm requirements'
$ rvm reinstall ruby
or 
$ rvm install ruby