轉自 百度 -- dk
windows下安裝或升級時gem經常會碰到
Please update your PATH to include build tools or download the DevKitfrom 'http://rubyinstaller.org/downloads' and follow the instructionsat 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'
這是因為沒有安裝DevKit的緣故
這就需要下載Devkit包, 當時我在下載ruby的是時候,看到頁面 http://rubyforge.org/frs/?group_id=167上有個devkit-3.4.5r3-20091110.7z,最後證明這個包是過時的,不能用的, 一定要從http://rubyinstaller.org/downloads 這下載最新的,如果上面的地址被和諧了,就從 http://github.com/downloads/oneclick/rubyinstaller/DevKit-tdm-32-4.5.2-20110712-1620-sfx.exe 這下載。
下載完成後執行這個檔案,會解壓到這個一個目錄。
進入這個目錄,這個目錄就是 <DEVKIT_INSTALL_DIR>。
> cd <DEVKIT_INSTALL_DIR>> ruby dk.rb init#產生config.yml,這裡會檢查將要添加DevKit支援的Ruby列表,只支援通過RubyInstaller安裝的Ruby#如果這裡列出的Ruby與你的要求不符,可以手動修改> ruby dk.rb review #檢查要添加DevKit支援的Ruby列表是否有誤,可以略過> ruby dk.rb install[INFO] Updating convenience notice gem override for 'C:/Ruby192'[INFO] Installing 'C:/Ruby192/lib/ruby/site_ruby/devkit.rb'
檢查是否安裝成功
> gem install rdiscount --platform=rubyFetching: rdiscount-1.6.8.gem (100%)Temporarily enhancing PATH to include DevKit...Building native extensions. This could take a while...Successfully installed rdiscount-1.6.81 gem installedInstalling ri documentation for rdiscount-1.6.8...Installing RDoc documentation for rdiscount-1.6.8...
如果能安裝成功,就說明安裝成功。