我正在尝试在 Ubuntu 12.10 上安装 foodcritic gem。在Ubuntu 12.04中可以成功安装。我已经安装了以下要求:libxslt-dev、libxml2-dev、ruby1.9.3 和 make 软件包。但现在我尝试
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 gem 是 foodcritic 的要求,但它的安装失败了。 如何安装 foodcritic?
最佳答案
nokogiri-1.5.4 中内置了对 Ubuntu 12.10(或任何使用 -Werror=format-security
的基于 Debian 的系统)的支持。我建议安装最新版本(当前为 1.5.5)。它应该与 1.5.0 兼容,除了更多已修复的错误:) 请参阅 changelog了解更多信息。
看起来 foodcritic
由于 1.5.3 中的段错误而将版本锁定为 1.5.0(根据 its changelog ),但其中的修复之一1.5.4 修复了一个段错误,因此您可能需要修改 gem 以要求 ~> 1.5.4
,如果有效,请联系 gem 的作者。
关于rubygems - 在 Ubuntu 12.10 中安装 Nokogiri (v.1.5.0.) Gem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13085404/