Mongodb安装因自制软件和Xcode 8.1.1而失败 [英] Mongodb installation failed with homebrew and Xcode 8.1.1

查看:144
本文介绍了Mongodb安装因自制软件和Xcode 8.1.1而失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

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.

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

My system is running on OSX El Capitan version 10.11.6.

总有没有安装mongodb而不升级到Mac OS Sierra和Xcode 8.3.3吗?

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

推荐答案

我正在运行OSX 10.11.6,由于我的计算机较旧(2009年中的Macbook Pro)而无法更新至10.12.尝试安装MongoDB时遇到错误:

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:

`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.`

我目前拥有XCode 8.0,但无论如何都要花一些其他的变通方法.因此,我需要一个兼容的MongoDB构建. 3.0.6是兼容的. 要使用Homebrew通过命令行进行安装,请执行以下操作:

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:

`user$ brew search mongodb`

并收到以下答案:

`==> Searching local taps...
 mongodb                 mongodb@3.0             mongodb@3.2             
 mongodb@3.4             percona-server-mongodb`

现在:

`$ brew install mongodb@3.0`

好的,接下来我要给自己做一个关于在根目录中创建这些下一个目录的说明,但是我是在当前用户(在OS上具有管理访问权限)中完成的.这些命令必须准确且按以下顺序进行:

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`

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

(enter your OSX User password when prompted)

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

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

下一个来自另一个S.O.答案:如何使用自制软件安装mongodb的早期版本? a>

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

`$ brew link --force mongodb@3.0`

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

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

`$ echo 'export PATH="/usr/local/opt/mongodb@3.0/bin:$PATH"' >> 
 ~/.bash_profile`

现在,您可以使用以下命令将Mongo作为守护程序运行:

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

`$ mongod`

它现在应该在27017端口上侦听,并且在另一个终端选项卡中,您可以运行$ mongo并使用此选项卡输入您的Mongo查询和命令.在另一个选项卡中运行它很重要;允许$ mongod保持原状并监控流量.

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

已要根据@ user122121注释和更新的格式来更新brew versions <>命令.

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

这篇关于Mongodb安装因自制软件和Xcode 8.1.1而失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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