mongodb - MacOS上安装mongodb时的问题
问题描述
我试图在我的 Mac 上安装 mongodb。但是出现了下面的错误信息。有人请告诉我解决方案。
Updating Homebrew...
==> Installing mongodb-community from mongodb/brew
==> Downloading https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-4.4.1.tgz
Already downloaded: /Users/t17akeru/Library/Caches/Homebrew/downloads/d46781539dca95a7ced7d9b466b13bd4cc0202f17a8bf4bd499a5e1a4a241262--mongodb-macos-x86_64-4.4.1.tgz
Error: Failed to install plist file
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall mongodb/brew/mongodb-community`
==> Caveats
To have launchd start mongodb/brew/mongodb-community now and restart at login:
brew services start mongodb/brew/mongodb-community
Or, if you don't want/need a background service you can just run:
mongod --config /usr/local/etc/mongod.conf
==> Summary
/usr/local/Cellar/mongodb-community/4.4.1: 11 files, 136.8MB, built in 4 seconds
==> `brew cleanup` has not been run in 30 days, running now...
Error: Permission denied @ apply2files - /usr/local/share/5.2/luarocks/add.lua
解决方案
MongoDB 已正确安装。问题在于 plist 文件的安装(例如,它允许您在计算机启动时启动 MongoDB)。您仍然可以使用mongod --config /usr/local/etc/mongod.conf
.
此外, brew 似乎有一些权限问题。以下是此 GitHub 问题的一些可能解决方案:
重新安装 Brew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
在 /usr/local 中重置权限
sudo chown -R $(whoami):admin /usr/local/* \
&& sudo chmod -R g+rwx /usr/local/*
然后,您可以尝试使用运行 MongoDB 的安装后脚本brew postinstall mongodb/brew/mongodb-community
希望它有所帮助!
推荐阅读
- python - HaarCascade 训练:合并 .lst 文件
- flask-sqlalchemy - 如何对 flask-admin 数据库列执行操作以将结果存储在同一表的其他列中
- python - 使用自签名证书将 pip install 安装到私有 pypi 服务器时如何忽略引发的安全警告
- laravel - 如何配置 Laravel Passport 的 '/oauth/token' 速率限制?
- django - Markdown 模板无法正确呈现 HTML
- c# - Removing items in a list of list
- elixir - Ecto query unique through a belongs_to association?
- c - 使用后量子公钥算法在 C 中创建 X509 证书?
- groovy - Groovy 流为 .peek 和 .map 提供 MissingMethodException
- java - ActiveMQ 是否支持消费者的最大消息处理时间