dbreunig said over 3 years ago on A Rubyist's Apple M1 Review :
  I'm using the alternative installation of Homebrew, as detailed here, which worked great for wget, postgres, etc. Nokogiri installs with no errors with the `--use-system-libraries` flag. However, it will fail when a program attempts to load it with the following error:

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': dlopen(/Library/Ruby/Gems/2.6.0/gems/nokogiri-1.10.10/lib/nokogiri/nokogiri.bundle, 0x0009): missing compatible arch in /Library/Ruby/Gems/2.6.0/gems/nokogiri-1.10.10/lib/nokogiri/nokogiri.bundle - /Library/Ruby/Gems/2.6.0/gems/nokogiri-1.10.10/lib/nokogiri/nokogiri.bundle (LoadError)