loading...empty;done;/ruby-dependency-management/:-uriRuby Dependency Management | iNET.elastic Dev Docs

Ruby Dependency Management

All Ruby-based application servers (Apache and NGINX) are provided with the Bundler dependency manager by default. It automatically tracks and installs dependencies required by your application. You only need to specify the list of required gems in Gemfile, which will resolve all dependencies.

Bundler performs dependency resolving in the following cases:

After any of the actions mentioned above, Bundler searches RubyGems.org (Ruby community’s gem hosting service) for dependencies listed in the config file and, if needed, installs them. By default, Ruby application servers are provided only with gems required for the example application’s work.

Ruby Gemfile dependencies

Gemfile supports a non-strict version declaration (e.g. greater than specified version, “jquery-rails”, “~> 2.0.2”). In such a case, the Bundler will download and install the latest version of the corresponding gem on each dependency resolving action.

Also, if your application uses any special (non-public) dependencies, you need to specify their repository URL in Gemfile. In such a way, Bundler will be able to download and install these gems.

Note: When redeploying a Ruby environment, ensure that a new engine version is correctly covered in the Gemfile. Otherwise, you’ll get a discrepancy error after the process.

We recommend using a non-strict Ruby version declaration in your Gemfile, for example ruby “~> 2.6.0”. Such a flexible form prevents you from interrupting your deployment or CI process while being able to upgrade your Ruby version.

What’s next?