So I spent some time trying to debug the issue but came up empty. The load path are really similar:
During the build: ----- LOAD_PATH ----- /<<PKGBUILDDIR>>/spec /<<PKGBUILDDIR>>/spec /<<PKGBUILDDIR>>/lib /<<PKGBUILDDIR>>/debian/ruby-arbre/usr/lib/ruby/vendor_ruby . /usr/share/rubygems-integration/all/gems/did_you_mean-1.2.1/lib /usr/local/lib/site_ruby/2.5.0 /usr/local/lib/x86_64-linux-gnu/site_ruby /usr/local/lib/site_ruby /usr/lib/ruby/vendor_ruby/2.5.0 /usr/lib/x86_64-linux-gnu/ruby/vendor_ruby/2.5.0 /usr/lib/ruby/vendor_ruby /usr/lib/ruby/2.5.0 /usr/lib/x86_64-linux-gnu/ruby/2.5.0 ----- END OF DEBUG ----- During autopkgtest: ----- LOAD_PATH ----- /tmp/autopkgtest.2xpQvK/build.tPa/src/spec /tmp/autopkgtest.2xpQvK/build.tPa/src/spec . /usr/share/rubygems-integration/all/gems/did_you_mean-1.2.1/lib /usr/local/lib/site_ruby/2.5.0 /usr/local/lib/x86_64-linux-gnu/site_ruby /usr/local/lib/site_ruby /usr/lib/ruby/vendor_ruby/2.5.0 /usr/lib/x86_64-linux-gnu/ruby/vendor_ruby/2.5.0 /usr/lib/ruby/vendor_ruby /usr/lib/ruby/2.5.0 /usr/lib/x86_64-linux-gnu/ruby/2.5.0 ----- END OF DEBUG ----- Nothing stood out in the environment variables. I tried running the rake outside of gem2deb in autopkgtest (also playing with the GEM_PATH and GEM_HOME) but I have the same exact error than with gem2deb. I'll go sleep on it and see if I or anybody else has other ideas tomorrow. Joseph