Macはhomebrewでrabbitmqをインストールする

1919 ワード

ここではhomebrewを使用してrabbitmqをインストールします
1.端末を開き、インストールコマンドを入力する
brew install rabbitmq
インストール中に次のエラーが発生した場合:
Error: Failed to download resource "erlang"
Download failed: https://homebrew.bintray.com/bottles/erlang-20.2.2.high_sierra.bottle.tar.gz
Warning: Bottle installation failed: building from source.
Error: The following formula:
  erlang
cannot be installed as a binary package and must be built from source.
Install the Command Line Tools:
  xcode-select --install
エラーメッセージに従って、xcodeをインストールする必要があります.端末に以下のコマンドを入力してインストールします.
xcode-select --install
2.インストールが完了すると、またエラーが発生します.
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into/usr/local
Could not symlink sbin/cuttlefish
/usr/local/sbin is not writable.
You can try again using:
  brew link rabbitmq
/usr/local/sbinには書く権限がありません.解決策は次のコマンドを入力します.
sudo chown -R `whoami`:admin /usr/local/sbin

参考:
http://blog.blakesimpson.co.uk/read/89-fix-homebrew-error-usr-local-bin-is-not-writable-on-os-x-el-capitan
http://blog.csdn.net/afanyusong/article/details/78538467
brew link rabbitmqを入力して成功したかどうかを確認します
3.rabbitmqサービススクリプトは/usr/local/sbinにインストールされていますが、このパスは自動的にPATHに追加されませんので、手動でPATHに追加する必要があります.
bash_の編集profile
vi ~/.bash_profile

iを入力して編集モードに入り、ファイルに次の文を追加します.
export PATH=$PATH:/usr/local/sbin

escをクリックして終了し入力:wq(保存終了)
4.rabbitmqの起動
rabbitmq-server

この起動方法ではrabbitmqはバックグラウンドでサービスとして実行されません.必要に応じて次のコマンドを使用できます.
brew services start rabbitmq

rabbitmq管理インタフェースへのアクセス
http://localhost:15672/
rabbitmqのデフォルトアカウントguestを使用してログインできます
参照先:
https://www.jianshu.com/p/5eb62a6d249d
http://www.rabbitmq.com/install-homebrew.html