'json'本機gem需要安裝構建工具 - The 'json' native gem requires installed build tools

問題:

I have ruby 1.9.2p180 (2011-02-18) [i386-mingw32] installed on my windows 7 machine. 我在我的Windows 7機器上安裝了ruby 1.9.2p180 (2011-02-18) [i386-mingw32] Now I tried to install the JSON gem using the command, "gem install json" and got the following error. 現在我嘗試使用命令“gem install json”安裝JSON gem並得到以下錯誤。

ERROR:  Error installing JSON:
    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][1]' and follow the instructions
at '[http://github.com/oneclick/rubyinstaller/wiki/Development-Kit][2]'

Then I went and downloaded DevKit-4.5.0-20100819-1536-sfx.exe. 然後我去下載DevKit-4.5.0-20100819-1536-sfx.exe。 Extracted it to C:\\DevKit. 將它提取到C:\\ DevKit。 And then from the command prompt, I executed the following commands. 然後從命令提示符執行以下命令。

ruby dk.rb init

After the above command is executed, I verified that config.yaml is generated and it has the path for my ruby folder added automatically. 執行上述命令後,我確認已生成config.yaml,並且它自動添加了我的ruby文件夾的路徑。 This is the line at the bottom of the config.yaml file "- C:/Ruby192" 這是config.yaml文件底部的行“ - C:/ Ruby192”

ruby dk.rb review

I got the message that devkit functionality will be injected into the rubies when you run "ruby dk.rb install" 我得到的消息是,當您運行“ruby dk.rb install”時,devkit功能將被注入到rubies中

ruby dk.rb install

I got the following message. 我收到以下消息。

[INFO] RubyGems override already in place for C:/Ruby192, skipping.
[INFO] Installing C:/Ruby192/lib/ruby/site_ruby/devkit.rb

Now I tried executing the JSON gem again using the command gem install json . 現在我嘗試使用命令gem install json再次執行JSON gem。 Then got the same error message as before. 然後得到與以前相同的錯誤消息。

ERROR:  Error installing JSON:
    The 'json' native gem requires installed build tools.........

Am I missing something? 我錯過了什麼嗎?


解決方案:

參考一: https://en.stackoom.com/question/XzPX
參考二: https://stackoom.com/question/XzPX
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章