Skip to content

LoadError due to llhttp native extension loading when using http gem with Bundler standalone mode #802

@Annih

Description

@Annih

Environment

  • OS: Rocky Linux 8.10
  • Ruby: 3.1.4 (EOL I know)
  • Gems:: bundler 2.4.22, http 5.3.0, lhttp 0.6.1

Problem

After the recent switch to the llhttp native Ruby binding (#800), using the http gem in environments that rely on Bundler’s --standalone mode results in a LoadError when requiring the native extension. This is due to the way llhttp loads its native extension using require_relative, which fails when the extension is not located relative to the Ruby file (as is common in standalone or custom deployment setups).

Error example:

LoadError:
  cannot load such file -- /app/bundle/ruby/3.1.0/gems/llhttp-0.5.0/lib/llhttp_ext
# ./bundle/ruby/3.1.0/gems/llhttp-0.5.0/lib/llhttp/parser.rb:52:in `require_relative'
# ...

Analysis

Suggested Action

  • Consider documenting this issue for users of the http gem until the fix is released in llhttp.
  • Optionally, add a compatibility note or version constraint for llhttp in the http gem’s dependencies to ensure users get the fixed version once released.
  • If possible, add a test or CI job for Bundler standalone mode to catch similar issues in the future. (I know this is kind of niche 🤷‍♂ )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions