ocran
ocran copied to clipboard
require 'zlib' fails with LoadError 14001 on packaged executable
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.
- 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.