使用自制软件和 Xcode 8.1.1 安装 Mongodb 失败

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/48251108/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 10:31:28  来源:igfitidea点击:

Mongodb installation failed with homebrew and Xcode 8.1.1

xcodemongodbmacosinstallation

提问by remonses

On running brew install mongodb, I get the following output:

在运行时brew install mongodb,我得到以下输出:

Updating Homebrew...
mongodb: A full installation of Xcode.app 8.3.2 is required to compile this software.
Installing just the Command Line Tools is not sufficient.
Xcode can be installed from the App Store.
Error: An unsatisfied requirement failed this build.

My system is running on OSX El Capitan version 10.11.6.

我的系统在 OSX El Capitan 版本 10.11.6 上运行。

Is there anyway to install mongodb without upgrading it to Mac OS Sierra and Xcode 8.3.3?

无论如何要安装mongodb而不将其升级到Mac OS Sierra和Xcode 8.3.3?

回答by andrewbfr

I am running OSX 10.11.6, unable to update to 10.12 because my machine is older (mid-2009 Macbook Pro). While trying to install MongoDB I ran into the error:

我正在运行 OSX 10.11.6,无法更新到 10.12,因为我的机器较旧(2009 年中 Macbook Pro)。在尝试安装 MongoDB 时,我遇到了错误:

`mongodb: A full installation of Xcode.app 8.3.2 is required to compile 
this software.
Installing just the Command Line Tools is not sufficient.
Xcode can be installed from the App Store.
Error: An unsatisfied requirement failed this build.`

I presently have XCode 8.0, which took some other kind of run-around to get anyway. So I needed a compatible MongoDB build. 3.0.6 is compatible. To install through the command line with Homebrew:

我目前有 XCode 8.0,无论如何它需要一些其他类型的运行。所以我需要一个兼容的 MongoDB 构建。3.0.6 兼容。使用 Homebrew 通过命令行安装:

`user$ brew search mongodb`

And receive this answer:

并收到这个答案:

`==> Searching local taps...
 mongodb                 [email protected]             [email protected]             
 [email protected]             percona-server-mongodb`

Now:

现在:

`$ brew install [email protected]`

OK, next I have a note to myself about creating these next directories in my root directory, but I did it in my current User (which has administrative access on the OS). These commands need to be precise and in this order:

好的,接下来我有一个关于在我的根目录中创建这些下一个目录的笔记,但我是在我当前的用户(在操作系统上具有管理访问权限)中完成的。这些命令需要精确并按以下顺序:

`$ sudo mkdir -p /data/db`

(enter your OSX User password when prompted)

(出现提示时输入您的 OSX 用户密码)

`$ sudo chown -R $USER /data/db`

`$ sudo chmod go+w /data/db`

This next one came from another S.O. answer: How to install earlier version of mongodb with homebrew?

下一个来自另一个 SO 答案:How to install early version of mongodb with homebrew?

`$ brew link --force [email protected]`

This next command is provided after successful completion of the --forcecommand:

成功完成--force命令后提供下一个命令:

`$ echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> 
 ~/.bash_profile`

Now, you can run your Mongo as a Daemon with:

现在,您可以将您的 Mongo 作为守护进程运行:

`$ mongod`

It should now be listening on Port 27017, and in another terminal tab you can run $ mongoand use this tab to enter your Mongo queries and commands. Running it in another tab is important; allowing $ mongodto sit untouched and monitor traffic is necessary.

它现在应该正在侦听端口 27017,并且在另一个终端选项卡中,您可以运行$ mongo并使用此选项卡输入您的 Mongo 查询和命令。在另一个选项卡中运行它很重要;允许$ mongod原封不动地坐着并监控交通是必要的。

Edited: To update brew versions <>command per @user122121 comment and updated formatting.

编辑:brew versions <>根据@user122121 评论和更新的格式更新命令。

回答by Wan Bachtiar

Is there anyway to install mongodb without upgrading it to Mac OS Sierra and Xcode 8.3.3?

无论如何要安装mongodb而不将其升级到Mac OS Sierra和Xcode 8.3.3?

Unfortunately in order to install Xcode 8.3+ you are required to be on MacOS Sierra 10.12. See Xcode compatibility requirements in Apple App Store for more information.

不幸的是,为了安装 Xcode 8.3+,您需要使用 MacOS Sierra 10.12。有关更多信息,请参阅 Apple App Store 中的 Xcode 兼容性要求。

An alternative way is to download MongoDB Community edition through MongoDB Download Center, and then follow the Install MongoDB Community Edition on MacOSinstruction.

另一种方法是通过MongoDB 下载中心下载 MongoDB 社区版,然后按照在 MacOS 上安装 MongoDB 社区版的说明进行操作。

回答by mzoz

You can download mongodb-app from github: https://github.com/gcollazo/mongodbapp

可以从github下载mongodb-app:https: //github.com/gcollazo/mongodbapp

I was able to successfully run mongodb4 with it on my machine, after brew installing failed.

在 brew 安装失败后,我能够在我的机器上成功运行 mongodb4。