Windows + pik環境へのvagrantインストール


$ pik use 1.9.2
$ gem install vagrant
ERROR:  Error installing vagrant:
        The 'json' native gem requires installed build tools.

Please update your PATH to include build tools or download the DevKit
from '' and follow the instructions
at ''




$ pik help package

Usage: pik package [options]

Downloads and installs packages.

  sqlite: 'pik package sqlite install'
  7zip:   'pik package 7zip install'
  devkit: 'pik package devkit install' # Installed to mingw versions only.


$ pik package devkit install
INFO: Downloading:
      to:  C:\dev\pik\downloads\DevKit-tdm-32-4.5.1-20101231-1457.7z

There was an error.
 Error: Failed to download Forbidden




ダウンロードしたファイルは自己解凍ファイルなので、これを C:\dev\devkit に展開しておきます。あとは手順に従ってインストールします。


$ cd C:\dev\devkit
$ ruby dk.rb init
Initialization complete! Please review and modify the auto-generated
'config.yml' file to ensure it contains the root directories to all
of the installed Rubies you want enhanced by the DevKit.

これで C:\dev\devkit\config.yml が生成されるのですが、pikで使用しているrubyのパスがうまく追加されないようなので手動で追加しておきます(最後の行)

# This configuration file contains the absolute path locations of all
# installed Rubies to be enhanced to work with the DevKit. This config
# file is generated by the 'ruby dk.rb init' step and may be modified
# before running the 'ruby dk.rb install' step. To include any installed
# Rubies that were not automagically discovered, simply add a line below
# the triple hyphens with the absolute path to the Ruby root directory.
# Example:
# ---
# - C:/ruby19trunk
# - C:/ruby192dev
- C:/dev/pik/rubies/ruby-1.9.2-p136


$ ruby dk.rb install
[INFO] Updating convenience notice gem override for 'C:/dev/pik/rubies/ruby-1.9.2-p136'
[INFO] Installing 'C:/dev/pik/rubies/ruby-1.9.2-p136/lib/ruby/site_ruby/devkit.rb'


$ gem install rdiscount --platform=ruby
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
Successfully installed rdiscount-1.6.8
1 gem installed
Installing ri documentation for rdiscount-1.6.8...
Installing RDoc documentation for rdiscount-1.6.8...

$ ruby -rubygems -e "require 'rdiscount'; puts'**Hello RubyInstaller**').to_html"
<p><strong>Hello RubyInstaller</strong></p>




$ gem install vagrant
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
Successfully installed json-1.5.4
Successfully installed log4r-1.1.10
Successfully installed net-ssh-2.2.2
Successfully installed net-scp-1.0.4
Successfully installed vagrant-1.0.5
5 gems installed
Installing ri documentation for json-1.5.4...
Installing ri documentation for log4r-1.1.10...
Installing ri documentation for net-ssh-2.2.2...
Installing ri documentation for net-scp-1.0.4...
Installing ri documentation for vagrant-1.0.5...
Installing RDoc documentation for json-1.5.4...
Installing RDoc documentation for log4r-1.1.10...
Installing RDoc documentation for net-ssh-2.2.2...
Installing RDoc documentation for net-scp-1.0.4...
Installing RDoc documentation for vagrant-1.0.5...


念のためvagrantも動作を確認しておきます。確認内容はGetting Startedページに書いてあるものを使います。


$ vagrant box add lucid32
$ vagrant init lucid32
$ vagrant up


PuTTY may not recognize the insecure_private_key provided by vagrant as a valid private key. To remedy this, first grab the PuTTYgen app. Then use PuTTYgen and import the insecure_private_key (found in the .vagrant.d dir in your home directory) and save a ppk file from that private key. Use the ppk file instead of the default one when SSHing into your vagrant box.



$ vagrant destroy