Dependency Management
Ruby Dependency Management
All Ruby application servers based on Apache or NGINX include Bundler by default. Bundler reads the application Gemfile, resolves required gems, and installs any missing dependencies automatically.
Bundler Dependency Management
Bundler tracks the gems required by a Ruby application. Add the required gems and version rules to the project Gemfile, and Bundler resolves the complete dependency tree.
When a required gem is not already installed, Bundler searches RubyGems.org and installs it. By default, the managed Ruby application-server images include only the gems required by the example application.
When Dependencies Are Resolved
Configure the Gemfile
The Gemfile can define exact versions or flexible version ranges for application gems.
source "https://rubygems.org" gem "rails", "~> 7.1" gem "jquery-rails", "~> 2.0.2" gem "pg", ">= 1.5"
With a non-strict declaration, Bundler installs the latest compatible version during each dependency-resolution action.

Flexible version rules
Use compatible version operators where appropriate so dependency installation is not interrupted unnecessarily when a newer compatible gem release becomes available.
Use Private Dependencies
When an application depends on a gem that is not publicly available through RubyGems.org, specify its repository URL in the Gemfile.
gem "custom_gem", git: "https://example.com/repository/custom_gem.git", branch: "main"
Bundler then downloads and installs the gem from the specified source.
Declare the Ruby Version
When redeploying a Ruby environment to another engine version, ensure that the new version is covered by the Gemfile. Otherwise, Bundler can report a Ruby-version discrepancy.
ruby "~> 3.3.0"
Recommended declaration
Use a non-strict Ruby version requirement, such as ruby "~> 3.3.0", when compatible upgrades should remain possible without interrupting deployment or continuous-integration workflows.
Expected Result
Bundler reads the project Gemfile after supported deployment or environment changes, resolves the required dependency versions, and installs missing gems from RubyGems.org or the configured private repositories.
Important Notes
- Bundler is preinstalled on Apache Ruby and NGINX Ruby application servers.
- Keep the Gemfile in the application project root.
- Use compatible version ranges when strict pinning is not required.
- Specify repository URLs for non-public gems.
- Update the Ruby version declaration before redeploying to another engine version.
- Review deployment logs when dependency resolution fails.
