brew install mongodb错误:怯ward地拒绝"sudo brew install" Mac OSX Lion [英] brew install mongodb error: Cowardly refusing to `sudo brew install' Mac OSX Lion

查看:91
本文介绍了brew install mongodb错误:怯ward地拒绝"sudo brew install" Mac OSX Lion的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不确定为什么会出现此错误:

I am not sure why I'm getting this error:

$ brew install mongodb
==> Downloading http://fastdl.mongodb.org/osx/mongodb-osx-x86_64-2.0.4.tgz
######################################################################## 100.0%
Error: Permission denied - /usr/local/var/log/mongodb

所以我尝试使用sudo运行它:

So I try to run it with sudo:

$ sudo brew install mongodb
Password:
Cowardly refusing to `sudo brew install'

如果我尝试自己创建文件,则会得到以下提示:

If I try to create the file myself I get this:

Error: File exists - /usr/local/var/log/mongodb

当您在自制的github上阅读有关该错误的线程时,它会变得更加有趣:

It gets even more interesting when you read this thread on homebrew's github about the error:

https://github.com/mxcl/homebrew/issues/9953

他们说brew因为它不是root而不能写文件,所以他们说这是因为他们认为文件不应该以root身份运行.

They state that brew can't write the file because it's not root, then they say it's because they think it shouldn't run as root.

这些是官方的安装说明,怎么了?

These are the official install instructions, what's up?

如果您有更好的安装建议,那么我会忘记自制软件.

If you have a better suggestion for installing it, then I'll forget about homebrew.

推荐答案

懒惰(酿造)方式:

ls -al /usr/local/bin/brew #confirm brew ownership
sudo chown root:wheel /usr/local/bin/brew
sudo brew install mongodb
sudo chown <your user>:<your group> /usr/local/bin/brew  #revert ownership

非酿造方式:

  • 从10gen下载mongodb发行版: http://www.mongodb.org/downloads
  • 在/usr/local/bin/
  • 中安装文件
  • 在/etc/mongo.conf中创建一个配置文件(最低限度,告诉它存储数据的位置,并可能告诉它仅绑定到本地主机):
  • Download mongodb distribution from 10gen: http://www.mongodb.org/downloads
  • Install files in /usr/local/bin/
  • Create a config file in /etc/mongo.conf (minimum, tell it where to store data, and probably tell it to bind only to localhost): http://www.mongodb.org/display/DOCS/File+Based+Configuration
  • Create a startup script that calls mongod -f /etc/mongo.conf

这篇关于brew install mongodb错误:怯ward地拒绝"sudo brew install" Mac OSX Lion的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆