Skip to content

[BUG] Gemspec ruby version conditional bakes wrong Faraday constraint into published gem #682

Description

@DustinFisher

Basic checks

  • I searched existing issues - this hasn't been reported
  • I can reproduce this consistently
  • This is a RubyLLM bug, not my application code

What's broken?

The ruby_llm.gemspec uses Gem.ruby_version to conditionally set the Faraday dependency, but this evaluates at gem build time, not install time.

Since the release workflow (.github/workflows/release.yml:24) uses ruby-version: "4.0", every published gem since v1.12.0 hardcodes faraday >= 2.0 instead of the intended >= 1.10.0.

How to reproduce

  1. gem fetch ruby_llm -v 1.12.0
  2. gem specification ruby_llm-1.12.0.gem | grep -A 5 'name: faraday'
  3. Observe faraday >= 2.0 is baked in, despite the source code intending >= 1.10.0 for Ruby < 4.0

Compare with v1.11.0 (before the conditional was added):

  1. gem fetch ruby_llm -v 1.11.0
  2. gem specification ruby_llm-1.11.0.gem | grep -A 5 'name: faraday'
  3. Observe faraday >= 1.10.0

Expected behavior

Published gems should allow faraday >= 1.10.0 for all Ruby versions, as intended by the else branch in the gemspec. Bundler should resolve to Faraday v2+ on Ruby 4.0 since Faraday v1 doesn't support it.

What actually happened

Every gem from v1.12.0 through v1.13.2 requires faraday >= 2.0, breaking users on older Faraday versions. Root cause is commit f3dfe31c which added the Gem.ruby_version conditional to ruby_llm.gemspec

Environment

  • Ruby version: Any (issue is in the build pipeline, not runtime)
  • RubyLLM version: 1.12.0 through 1.13.2
  • Provider: N/A
  • OS: N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions