Skip to content

Instantly share code, notes, and snippets.

@jaydorsey
Last active February 26, 2024 14:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaydorsey/46f246413f78a71dfff2aa7a4295a192 to your computer and use it in GitHub Desktop.
Save jaydorsey/46f246413f78a71dfff2aa7a4295a192 to your computer and use it in GitHub Desktop.
WARNING: Nokogiri was built against libxml version

My setup

For reference only:

  1. rtx-cli
  2. Ruby 3.2.0
  3. Most dependencies installed via Homebrew
  4. macOS 14.2.1
  5. M3 Max chip

The error

My complete error is:

WARNING: Nokogiri was built against libxml version 2.9.13, but has dynamically loaded 2.12.5

Things I've tried

  1. gem install nokogiri -v 1.16.2 --platform=ruby -- --use-system-libraries
  2. export NOKOGIRI_USE_SYSTEM_LIBRARIES=true
  3. Deleting every nokogiri folder under ~/.local/share/rtx/installs/ruby 4. gem install nokogiri
  4. bundle pristine nokogiri
  5. gem pristine nokogiri
  6. gem uninstall nokogiri -aIx && NOKOGIRI_USE_SYSTEM_LIBRARIES=1 bundle install
  7. gem uninstall nokogiri -aIx && bundle config build.nokogiri "--use-system-libraries" && bundle install`
  8. gem update --system && gem pristine nokogiri
  9. gem uninstall nokogiri -aIx && gem install nokogiri -- --with-xml2-include=/usr/include/libxml2/libxml --with-xml2-lib=/usr/lib64/ --with-xslt-include=/usr/include/libxslt --with-xslt-lib=/usr/lib64/

Things that worked

  1. gem uninstall nokogiri -aIx && bundle config build.nokogiri "--with-xml2-include=/usr/include/libxml2/libxml --with-xml2-lib=/usr/lib64/ --with-xslt-include=/usr/include/libxslt --with-xslt-lib=/usr/lib64/" && bundle install

I think this probably worked because I have brew install libxml2 libxslt. I'm also not sure why this worked, because the paths that are passed as arguments above don't seem to be actual paths on my file system?

Things I didn't try

  1. bundle config set force_ruby_platform true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment