vagrantを使って、開発環境を作りたい時もあるでしょう。
この記事では、vagrantとvirtualBoxのインストール方法を書きます。
vagrantダウンロード
vagrantのダウンロードページに進み、任意のボタンをクリックする。
Download - Vagrant by HashiCorp
自分はMacを使っているので、Macのリンクをクリックしてインストール。
Windowsの方は、windowsのボタンをクリックすればいけるはず。
インストールしたらこんな画面が出てくる。 「vagrant.pkg」をクリックし、インストールしよう。
あとは画面にしたがって進んでいくだけ。
インストールが完了したらこんな画面になる。 これでvagrantコマンドが使えるようになります。
VirtualBoxインストール
vagrantを入れて、vagrantコマンドを使えるようになってもエラーが起きます。
No usable default provider could be found for your system. Vagrant relies on interactions with 3rd party systems, known as "providers", to provide Vagrant with resources to run development environments. Examples are VirtualBox, VMware, Hyper-V. The easiest solution to this message is to install VirtualBox, which is available for free on all major platforms. If you believe you already have a provider available, make sure it is properly installed and configured. You can see more details about why a particular provider isn't working by forcing usage with `vagrant up --provider=PROVIDER`, which should give you a more specific error message for that particular provider.
上記はvagrantのみを入れて、vagrant upをして起きたエラーです。 providerがねえよカスとか言われてますね。
Vagrant relies on interactions with 3rd party systems, known as "providers", to provide Vagrant with resources to run development environments. Examples are VirtualBox, VMware, Hyper-V.
例として、VirtualBox, VMware, Hyper-Vが挙げられていますね。 今回は、VirtualBoxを入れてみましょう。
https://www.virtualbox.org/wiki/Downloads
上記のページから任意のものをインストールします。
この部分ですね。自分はmacなのでmacと書かれているものをクリックしてインストール。 若干時間がかかるので、待ちましょう。
こんな画面になるので、画面にしたがってインストールしましょう。
これでok。 vagrant upもこれでできるはずです。