Local Gemset vs System Ruby: Which Ruby SDK Configuration Avoids Production Failures?
20.5K reputation · 21 Nov 2024, 12:30 UTC
Goal
Ensure that a RubyMine project runs with the same dependencies locally and in production, preventing “works on my machine” failures during deployment.
Constraints
RubyMine automatically selects the interpreter defined in project settings, but it does not apply the gemset specified by .ruby-version or .ruby-gemset unless the developer explicitly adds the gemset to the Ruby SDK list or configures Bundler to use the system Ruby. This mismatch can cause locally installed gems to be missing in a production environment that uses the system Ruby.
Unresolved Decision
Should developers enforce the same Ruby SDK (and gemset) across all environments, or should they rely on Bundler’s “Use Bundler” option to run commands against the system Ruby?
Questions
- Does adding the local gemset to RubyMine’s SDK list guarantee that the same gems are available in CI/CD pipelines that use the system Ruby?
- What are the trade‑offs of configuring Bundler to run against the system Ruby instead of the local gemset?
- How does each approach affect reproducibility of dependency resolution in automated deployments?