Environment Variables Defined by the Ruby Buildpack

Page last updated:

Warning: Pivotal Cloud Foundry (PCF) v2.5 is no longer supported because it has reached the End of General Support (EOGS) phase as defined by the Support Lifecycle Policy. To stay up to date with the latest software and security updates, upgrade to a supported version.

Pivotal Application Service (PAS) provides configuration information to apps through environment variables. This topic describes the additional environment variables provided by the Ruby buildpack.

For more information about the standard environment variables provided by PAS, see PAS Environment Variables.

Ruby Buildpack Environment Variables

The following table describes the environment variables provided by the Ruby buildpack.

Environment Variable Description
BUNDLE_BIN_PATH The directory where Bundler installs binaries. For example: BUNDLE_BIN_PATH:/home/vcap/app/vendor/bundle/ruby/1.9.1/gems/bundler-1.3.2/bin/bundle
BUNDLE_GEMFILE The path to the Gemfile for the app. For example: BUNDLE_GEMFILE:/home/vcap/app/Gemfile
BUNDLE_WITHOUT Instructs PAS to skip gem installation in excluded groups. Use this with Rails apps, where “assets” and “development” gem groups typically contain gems that are not needed when the app runs in production. For example: BUNDLE_WITHOUT=assets
DATABASE_URL PAS examines the database_uri for bound services to see if they match known database types. If known relational database services are bound to the app, then the DATABASE_URL environment variable is set to the first services in the list. If your app requires that DATABASE_URL is set to the connection string for your service, and PAS does not set it, use the Cloud Foundry Command Line Interface (cf CLI) cf set-env command to set this variable manually. For example: cf set-env my-app DATABASE_URL mysql://example-database-connection-string
GEM_HOME The directory where gems are installed. For example: GEM_HOME:/home/vcap/app/vendor/bundle/ruby/1.9.1
GEM_PATH The directory where gems can be found. For example: GEM_PATH=/home/vcap/app/vendor/bundle/ruby/1.9.1:
RACK_ENV The Rack deployment environment, which governs the middleware loaded to run the app. Valid value are development, deployment, and none. For example: RACK_ENV=none
RAILS_ENV The Rails deployment environment, which controls which environment-specific configuration file governs how the app is executed. Valid values are development, test, and production. For example: RAILS_ENV=production
RUBYOPT Defines command-line options passed to Ruby interpreter. For example: RUBYOPT: -I/home/vcap/app/vendor/bundle/ruby/1.9.1/gems/bundler-1.3.2/lib -rbundler/setup