我安装“
redcarpet
”宝石时遇到以下错误。不过,我的朋友的机器上安装没有问题。(我想安装这个来运行yard
)
Ruby版本:1.9.3
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
更新: 按照https://github.com/oneclick/rubyinstaller/wiki/Development-Kit中提供的开发工具包安装说明进行安装后,当我测试json gem安装时也失败了 :(
我参考了在github上的故障排除链接Native gem extension Error并按照说明进行解决,但问题仍然存在..
我将这两个路径添加到环境变量中C:\\ruby_devkit\\bin;C:\\ruby_devkit\\mingw\\bin;
,这样就不会出现Temporarily enhancing PATH to include DevKit...
的命令行提示了。
gem update --system
命令更新即可解决问题。不要降级,这样做无法解决问题! - Private_GER