LoginSignup
45
42

More than 3 years have passed since last update.

Vagrantのインストール(macOS編)

Last updated at Posted at 2016-07-21

インストールするもの

Vagrantをインストール、動作させるのに必要なものをインストールします。
具体的には以下をインストールします。

  • Homebrew
  • VirtualBox
  • Vagrant

Homebrewを先にインストールしてください。VirtualBox、VagrantはHomebrewからインストールします。

Homebrewのインストール

http://brew.sh/
に書かれているコマンドを実行します。
次のコマンドです。

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Homebrewの動作チェック

Homebrewが正常に動作するか確認します。次のコマンドを実行し、Your system is ready to brew.が表示されるまで指示に従って問題を解消してください。

brew doctor

VirtualBoxのインストール

VirtualBoxをインストールします。
次のコマンドを実行します。

brew cask install virtualbox

インストール中にパスワード入力を求められたら入力して下さい。

Vagrantのインストール

Vagrantをインストールします。
次のコマンドを実行します。

brew cask install vagrant

アップデート方法

brew caskでインストールしたものをアップデートするには次のコマンドを実行します。

brew cask upgrade

トラブルシューティング

Vagrant 1.8.7

vagrant box add でエラーが発生する

box未取得で vagrant up 時に取得する場合もエラーが発生します。
この問題はmacOS版のみ発生します。
原因としてはVagrantに含まれているcurl関連に問題があるようです。

対策としてはVagrant 1.8.6に戻すか、Vagrantに含まれているcurlを削除します。

45
42
2

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
45
42