Hugo + Asciidoctor (+ direnv + bundler)

I previously installed hugo and asciidoctor from my system package manager, and all was well. I wanted more control over asciidoctor and its extensions so I added a Gemfile, used direnv to inform bundler to install ruby gems within the project instead of globally, and ran bundler install

The asciidoctor cli works manually but not when hugo runs it. It also works when I install my gems locally or to the default user location (~/.gem). It also works when I use security.exec.osEnv = ['.*'].

I’d like to know what env vars I should pass through for asciidoctor to be useable. I’ve tried security.exec.osEnv = ['^GEM_HOME$', '^BUNDLE_BIN$'], since those are what direnv sets, but it didn’t help.

The error I get with my preferred setup is

ruby: error in `materialize': Could not find $ANYTHING in locally installed gems (Bundler::GemNotFound)