windows下安裝或升級時gem經常會碰到
1 |
Please update your PATH to include build tools or download the DevKit |
這是因爲沒有安裝DevKit的緣故。
DevKit 是windows平臺下編譯和使用本地C/C++擴展包的工具。它就是用來模擬Linux平臺下的make, gcc, sh來進行編譯。注:這個方法目前僅支持通過RubyInstaller安裝的Ruby,如果不是建議你重新安裝。安裝方法:雙擊下載的7z文件,指定解壓路徑,路徑中不能有空格。如C:\DevKit,這個路徑就是<DEVKIT_INSTALL_DIR>。
1 |
> cd
<DEVKIT_INSTALL_DIR> |
7 |
[INFO] Updating convenience notice gem override
for 'C:/Ruby192' |
8 |
[INFO] Installing 'C:/Ruby192/lib/ruby/site_ruby/devkit.rb' |
檢查是否安裝成功
1 |
> gem install
rdiscount --platform=ruby |
2 |
Fetching: rdiscount-1.6.8.gem (100%) |
3 |
Temporarily enhancing PATH to include DevKit... |
4 |
Building native extensions. This could take a
while ... |
5 |
Successfully installed rdiscount-1.6.8 |
7 |
Installing ri documentation for
rdiscount-1.6.8... |
8 |
Installing RDoc documentation for
rdiscount-1.6.8... |
如果能安裝rdiscount成功說明安裝DevKit成功。
英文原版地址:https://github.com/oneclick/rubyinstaller/wiki/development-kit