Mac user and getting WARNING: Nokogiri was built against LibXML version 2.7.8, but has dynamically loaded 2.7.3

前端 未结 16 1428
暖寄归人
暖寄归人 2020-11-27 11:24

I have done all kinds of research and tried many different things. I know this question has been answered many times, but none of the suggested solutions are working for me.

相关标签:
16条回答
  • 2020-11-27 12:13

    gem install libxml-ruby helps me

    0 讨论(0)
  • 2020-11-27 12:18

    None of this worked for me.

    I had libxml2 installed at a later version (2.7.8) with brew. This caused nokogiri to compile against it and the later problems. Solution, remove it, then build, then install if desired.

    Here's what worked:

    • brew uninstall libxml2 (if previously installed)
    • gem uninstall nokogiri
    • gem install nokogiri
    • brew install libxml2 (optional)
    0 讨论(0)
  • 2020-11-27 12:18

    Bundler has options to set the default build locations. So for instance, with libxml2 installed via macports:

    $ bundle config build.nokogiri --with-xml2-include=/opt/local/include/libxml2 --with-xml2-lib=/opt/local/lib --with-xslt-dir=/opt/local
    

    After doing this and bundle install, the warning went away.

    There's also some helpful examples for setting build options on the nokogiri wiki.

    0 讨论(0)
  • 2020-11-27 12:18

    If you have this message and your nokogiri is out-of-date with the version available from the gem source, simply run bundle update nokogiri to get the new code and recompile. Your error should go away.

    0 讨论(0)
提交回复
热议问题