by shigemk2

当面は技術的なことしか書かない

Vagrantを動かす(たぶん途中)

「Chefを動かしたい!」という欲求に駆られてこの雑誌を購入したのはいいけど、
gem install chef 以降からハマってしまって、気付いたらvagrantで開発環境(仮想マシン)を自動構築しよう | Act as Professional - hiroki.jpから
Vagrantをインストールすることになってしまった。

$ sudo gem update

でアップデートしたあと

$ sudo gem install vagrant

として、

$ vagrant box add precise64 http://files.vagrantup.com/precise64.box

と実行しても

Vagrant could not detect VirtualBox! Make sure VirtualBox is properly installed.
Vagrant uses the `VBoxManage` binary that ships with VirtualBox, and requires
this to be available on the PATH. If VirtualBox is installed, please find the
`VBoxManage` binary and add it to the PATH environmental variable.

というエラーが出たので、

こちらVagrant Documentation - Getting Started
からdmgをインストールして、そのあとVirtualBoxをインストールしてみました。
何気にgem install vagrantよりこっちのほうが推奨されているようだ。

If a Vagrant package is not available for your platform, you can also install using RubyGems via a gem install vagrant. But note that the packages are the preferred and best supported method of installation.

Downloads – Oracle VM VirtualBox

で、上記のコマンドを実行すると、

A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.

となるので、

$ vagrant up