Installing nokogiri - Failed to build gem native extension

左心房为你撑大大i 提交于 2019-12-04 19:12:53

Is there a specific reason you need 1.4.4 instead of the latest 1.5.6? Otherwise I suggest upgrading.

The Nokogiri changelog shows they fixed this in 1.5.4:

Build support on hardened Debian systems that use -Werror=format-security. #680.

I stumbled at this trying to install bigbluebutton on ubuntu 13.04

I solved it doing this trick to compile reverting the -Wformat-security gcc flag systemwide

Be careful doing the first rm. It can break your whole system!!

rm /usr/bin/gcc
nano /usr/bin/gcc
    ## contents of /usr/bin/gcc
    #!/bin/sh
    gcc-4.7 $* -Wno-format-security
    ## save and exit
chmod u+x /usr/bin/gcc
gem install nokogiri -v '1.4.4'

@Confusion has the right idea.

Bundler is probably locked to nokogiri-1.4.4 in the Gemfile and/or Gemfile.lock. @Confusion's answer of running bundle update should allow your Ruby Bundler environment to use the successfully installed nokogiri-1.5.6.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!