在Ubuntu 12.10中安装Nokogiri(v.1.5.0。)Gem [英] Installing Nokogiri (v.1.5.0.) Gem In Ubuntu 12.10
问题描述
我试图在Ubuntu 12.10上安装foodcritic gem。它可以成功安装在Ubuntu 12.04中。我已经安装了需求: libxslt-dev , libxml2-dev , ruby1.9.3 和 make 包。但是,现在我试试
sudo gem install foodcritic
我得到以下错误:
编译xml_xpath_context.c
xml_xpath_context.c:在函数'xpath_generic_exception_handler'中:
xml_xpath_context.c:184:3:错误:格式不是字符串文本,也没有格式参数[-Werror = format-security]
cc1:视为错误
make:*** [xml_xpath_context.o]错误1
Gem文件将保留安装在/usr/lib/ruby/gems/1.9.1/gems/nokogiri- 1.5.0进行检查。
结果记录到/usr/lib/ruby/gems/1.9.1/gems/nokogiri-1.5.0/ext/nokogiri/gem_make.out
Nokogiri-1.5.0宝石是foodcritic的一个要求,而且它的市场定位失败了。
如何安装foodcritic?
支持Ubuntu 12.10(或任何基于Debian的系统,使用 -Werror = format-security
)内置于nokogiri-1.5.4中。我建议安装最新的(目前1.5.5)。它应该与1.5.0兼容,但有更多固定的bug除外:)有关更多信息,请参见更新日志。
由于1.5.3的段错误,看起来像 foodcritic
将版本锁定为1.5.0(根据 更新日志),但其中一项修正在1.5.4中修复了段错误,所以你可能想要修改gem来要求〜> 1.5.4
如果可以,请联系该宝石的作者。
I am trying to install foodcritic gem on Ubuntu 12.10. It could be successfully installed in Ubuntu 12.04. I have installed the requirements: libxslt-dev, libxml2-dev, ruby1.9.3 and make packages. But when now I try
sudo gem install foodcritic
I get the following error:
compiling xml_xpath_context.c
xml_xpath_context.c: In function ‘xpath_generic_exception_handler’:
xml_xpath_context.c:184:3: error: format not a string literal and no format arguments [-Werror=format-security]
cc1: some warnings being treated as errors
make: *** [xml_xpath_context.o] Error 1
Gem files will remain installed in /usr/lib/ruby/gems/1.9.1/gems/nokogiri-1.5.0 for inspection.
Results logged to /usr/lib/ruby/gems/1.9.1/gems/nokogiri-1.5.0/ext/nokogiri/gem_make.out
Nokogiri-1.5.0 gem is a requirement for foodcritic and it is it's instllation that fails. How can I install foodcritic?
Support for Ubuntu 12.10 (or any Debian-based system that uses -Werror=format-security
) was built into nokogiri-1.5.4. I recommend installing the latest (currently 1.5.5). It should be compatible with 1.5.0, except with more fixed bugs :) See the changelog for more information.
It looks like foodcritic
locked the version to 1.5.0 because of a segfault in 1.5.3 (according to its changelog) but one of the fixes in 1.5.4 fixes a segfault, so you may want to modify the gem to require ~> 1.5.4
and if it works, contact the author of the gem.
这篇关于在Ubuntu 12.10中安装Nokogiri(v.1.5.0。)Gem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!