安装'redcarpet
'gem时出现以下错误。不过,它在我朋友的机器上安装时没有出现问题。(我想安装它来运行yard
)Ruby版本:1.9.3
cmd输出:
D:LearningCommon_POM_FWSampleProjects>yard
[error]: Missing 'redcarpet' gem for Markdown formatting. Install it with `gem install redcarpet`
D:LearningCommon_POM_FWSampleProjects>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
更新:有关devkit安装说明,请访问https://github.com/oneclick/rubyinstaller/wiki/Development-Kit当我用json-gem测试安装时,它也失败了:(
我浏览了github Native gem扩展错误的疑难解答链接,并按照说明进行了解决,但问题仍然存在。。
我将这两条路径添加到Env var C:\ruby_devkit\bin;C:\ruby_devkit\mingw\bin;
。这将从cmd 上删除行Temporarily enhancing PATH to include DevKit...
最后,经过大量研究,我发现罪魁祸首是RubyGems版本与本地扩展gems不兼容!!!
我在2.4.1版本有红宝石宝石,但似乎>2.4.0版本有这些问题
gem update --system 2.3.0
帮我搞定了:)
参考:https://github.com/rubygems/rubygems/issues/977
降级红宝石宝石对我不起作用。
成功的是(安装了最新版本的ruby gems):
以管理员身份打开CMD,然后。。。
gem install json --platform=ruby --verbose
(答案由dannysmith在此处添加)