ocran icon indicating copy to clipboard operation
ocran copied to clipboard

require 'zlib' fails with LoadError 14001 on packaged executable

Open shinokaro opened this issue 9 months ago • 1 comments

When packaging a script that calls require 'zlib', the generated EXE fails at runtime with:

LoadError: 14001: The application has failed to start because its side-by-side configuration is incorrect.
…/x64-mingw-ucrt/zlib.so (LoadError)

This indicates that require 'zlib' cannot load the zlib extension in the packaged environment.

shinokaro avatar Apr 30 '25 23:04 shinokaro

  • It appears the error may be caused by the Side-by-Side manifest for zlib not being included in the packaged EXE.
  • Another possibility is that the DLL (zlib.dll) is present but the Ruby native extension (zlib.so) was not bundled.
  • It could also be a combination of both missing manifest and missing .so file.
  • When loading zlib via Fiddle with the manifest file present in the same folder, the error does not occur.
  • This issue may further depend on the specific RubyInstaller/MSYS2 version used to build the Ruby runtime.

shinokaro avatar Apr 30 '25 23:04 shinokaro