4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【2019年12月版】MacのHomebrewでMongoDBが見つからない問題の解決法

Last updated at Posted at 2019-12-04

QiitaでMacにMongoDBをインストールする記事を探すと、古く実行できない記事が多いので、2019年12月現在インストールできる方法を書いておこうと思います。

普通にHomebrewではインストールできない?

MongoDB を MacOSX にインストールしようと思い、以下のコマンドを実しました。

bash
$ brew install mongodb

しかし、以下のようなエラーが出てきました。

Warning: homebrew/core is shallow clone. To get complete history run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow

Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.

MongoDBが見つからないと出てきます。
どうやら Homebrew の Core Repository からは、MongoDBは削除されたようです。
(Qiitaには、この方法で入れる記事がたくさんありますが...)

解決方法

MongoDB公式で、 brew tap を使ってMongoDBのリポジトリを参照して入れることが推奨されています。

bash
# MongoDBのリポジトリを参照
$ brew services start mongodb-community

# MongoDBをインストール
$ brew install mongodb-community

# MongoDBを実行
$ brew services start mongodb-community

# MongoDBのバージョンを確認
$ mongo -version
MongoDB shell version v4.2.1
...

以上でインストールと確認ができると思います。

詳細は、公式リファレンスをご確認ください。

Mongo DB Official Reference "Install MongoDB Community Edition on macOS"
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/

4
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?