2012-10-26 108 views
2

我想在Ubuntu 12.10上安装foodcritic gem。它可以成功安装在Ubuntu 12.04中。我已经安装了要求:的libxslt-dev的的libxml2-dev的ruby​​1.9.3使包。但是,当我现在尝试安装Nokogiri(v.1.5.0。)Gem在Ubuntu 12.10

sudo gem install foodcritic 

我得到以下错误:

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宝石是foodcritic的要求,这是它的instllation失败。 我如何安装foodcritic?

回答

2

对于Ubuntu 12.10(或任何使用-Werror=format-security的基于Debian的系统)的支持已内置到nokogiri-1.5.4中。我建议安装最新的(目前1.5.5)。它应该与1.5.0兼容,除了更多的固定错误:)请参阅changelog了解更多信息。

它看起来像foodcritic(根据changelog),但修复的一个在1.5.4修复段错误,所以你可能要修改1.5.3锁定版本1.5.0,因为段错误的该宝石要求~> 1.5.4,如果它可行,请联系宝石的作者。

+1

很好,谢谢。我下载了gem(http://rubygems.org/gems/foodcritic),更改了元数据(nokogiri〜> 1.5.4)的需求,并根据http://stackoverflow.com/questions/2386996/how-to-install -a - 下载 - 红宝石宝石文件 –