gem install nokogiri -v '1.6.8.1' fails

前端 未结 4 792
轮回少年
轮回少年 2021-02-02 11:34

Building a new Rails app and getting a problem with nokogiri. Said to try gem install nokogiri -v \'1.6.8.1\' which fails with output below. I tried deleting Gemfil

相关标签:
4条回答
  • 2021-02-02 11:45

    Run this first:

    xcode-select --install
    

    Then rerun your bundle install

    Reference: https://github.com/sparklemotion/nokogiri/issues/1483

    0 讨论(0)
  • 2021-02-02 12:03

    I tried @the_basterd's recommendation. That didn't work, but the reference was good—thank you the_basterd. What worked from that reference was:

    brew install libxml2

    bundle config build.nokogiri --use-system-libraries --with-xml2-include=/usr/local/opt/libxml2/include/libxml2

    Reference: https://github.com/sparklemotion/nokogiri/issues/1483

    Later postings at that ref said that what I posted above "is strongly recommended against by the Nokogiri."

    brew unlink xz; bundle install; brew link xz is preferred.

    0 讨论(0)
  • 2021-02-02 12:06

    I ran into this issue with nokogiri-1.6.8.1 while using bundle install --path vendor/bundle to install directly into a project located within a Google Drive sync folder. The hangup seemed related to libxml2.

    While reading through the GitHub issue referenced by @Greg and @the_basterd, I noticed that someone was having trouble installing into a Box sync folder. Moving my project folder to another location worked.

    Not sure what the underlying problem is when installing to a sync folder, but I'd be interested to learn if anyone had any thoughts.

    Haven't tested this with Dropbox, but perhaps that would cause problems, too.

    0 讨论(0)
  • 2021-02-02 12:11

    You can also encounter the same error message if you've downloaded XCode Tools but haven't yet agreed to the license.

    From Terminal, run:

    sudo xcodebuild -license
    

    Enter your admin password, space through the agreement and type agree to accept. Run brew doctor and if necessary, brew update and you should be in good shape.

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