2014-10-09 194 views
4

安裝'redcarpet'gem時出現以下錯誤。儘管它在我的朋友機器上安裝時沒有問題。 (我想安裝此運行yard) 紅寶石版本:1.9.3錯誤:無法在Windows上構建gem本機擴展

CMD輸出:

D:\Learning\Common_POM_FW\SampleProjects>yard 
[error]: Missing 'redcarpet' gem for Markdown formatting. Install it with `gem install redcarpet` 

D:\Learning\Common_POM_FW\SampleProjects>gem install redcarpet 
Temporarily enhancing PATH to include DevKit... 
Building native extensions. This could take a while... 
ERROR: Error installing redcarpet: 
     ERROR: Failed to build gem native extension. 

    C:/Ruby193/bin/ruby.exe -r ./siteconf20141009-6544-978w4t.rb extconf.rb 
creating Makefile 

make clean 
Makefile:165: *** target pattern contains no `%'. Stop. 

make 
Makefile:165: *** target pattern contains no `%'. Stop. 

make failed, exit code 2 

Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/redcarpet-3.1.2 for inspectio 
n. 
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/extensions/x86-mingw32/1.9.1/redcarpet-3.1.2/gem_ma 
ke.out 

UPDATE:https://github.com/oneclick/rubyinstaller/wiki/Development-Kit提供的devkit的安裝說明我測試安裝與JSON寶石它也失敗那裏:(

我通過鏈接排除故障在github Native gem extension Error並遵循inst ructions來解決,但問題仍然存在..

我加了兩條路徑的環境變量C:\\ruby_devkit\\bin;C:\\ruby_devkit\\mingw\\bin;這從大量的研究後,出現在CMD

回答

27

最後刪除線Temporarily enhancing PATH to include DevKit...我發現罪魁禍首是RubyGems的版本不兼容問題原生延伸寶石!

我有紅寶石寶石版本2.4.1,但好像> 2.4.0有這些問題

gem update --system 2.3.0的伎倆對我來說:)

參見:https://github.com/rubygems/rubygems/issues/977

+0

謝謝。謝謝。謝謝。 – Ryan 2015-01-06 07:48:38

+0

英雄!我嘗試了大約37種解決方案......第38次幸運! – daddywoodland 2015-02-18 15:21:57

+0

謝謝!經過多次嘗試,這是有效的。 – firecape 2015-04-29 21:30:35

3

降級紅寶石寶石沒」爲我工作。

什麼做的工作是(與安裝最新版本的紅寶石寶石):

打開CMD,管理員和...

gem install json --platform=ruby --verbose 

(回答dannysmithhere加)

相關問題