Windows XP 環境でgem install railsが失敗した場合の対応。
C:>gem install rails Fetching: activesupport-3.1.3.gem (100%) Fetching: activemodel-3.1.3.gem (100%) Fetching: actionpack-3.1.3.gem (100%) Fetching: activerecord-3.1.3.gem (100%) Fetching: activeresource-3.1.3.gem (100%) Fetching: actionmailer-3.1.3.gem (100%) ERROR: Error installing rails: The 'json' native gem requires installed build tools. Please update your PATH to include build tools or download the DevKit from 'http://rubyinstaller.org/downloads' and follow the instructions at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'
DevKit を使いなさいとのこと。
Ruby Installer for Windowsのページで、DevKit-tdm-32-4.5.2-20110712-1620-sfx.exe をダウンロードして、適当なフォルダに解凍する。
そして下記にて初期化&インストール。
C:DevKit>ruby dk.rb init [INFO] found RubyInstaller v1.9.2 at C:/usr/local/ruby1.9.2 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:usrlocalDevKit>ruby dk.rb install [INFO] Updating convenience notice gem override for 'C:/usr/local/ruby1.9.2' [INFO] Installing 'C:/usr/local/ruby1.9.2/lib/ruby/site_ruby/devkit.rb'
再度、rails をインストール。
C:usrlocalDevKit>gem install rails Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... Fetching: rdoc-3.11.gem (100%) Depending on your version of ruby, you may need to install ruby rdoc/ri data: <= 1.8.6 : unsupported = 1.8.7 : gem install rdoc-data; rdoc-data --install = 1.9.1 : gem install rdoc-data; rdoc-data --install >= 1.9.2 : nothing to do! Yay! Fetching: railties-3.1.3.gem (100%) Fetching: rails-3.1.3.gem (100%) Successfully installed json-1.6.1 Successfully installed rdoc-3.11 Successfully installed railties-3.1.3 Successfully installed rails-3.1.3 4 gems installed Installing ri documentation for json-1.6.1... Installing ri documentation for rdoc-3.11... unable to convert U+00A9 from UTF-8 to Windows-31J for lib/rdoc/text.rb, skipping unable to convert "xD0" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to Windows-31J fo r History.rdoc, skipping Installing ri documentation for railties-3.1.3... Installing ri documentation for rails-3.1.3... Installing RDoc documentation for json-1.6.1... Installing RDoc documentation for rdoc-3.11... unable to convert U+00A9 from UTF-8 to Windows-31J for lib/rdoc/text.rb, skipping unable to convert "xD0" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to Windows-31J fo r History.rdoc, skipping Installing RDoc documentation for railties-3.1.3... Installing RDoc documentation for rails-3.1.3...
gem install rails 成功。