2012-10-26 160 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 - 下載 - 紅寶石寶石文件 –