Environment Variables Defined by the Ruby Buildpack
Page last updated:
When you use the Ruby buildpack, you get three Ruby-specific environment variables in addition to the regular Cloud Foundry environment variables.
BUNDLE_BIN_PATH— Location where Bundler installs binaries.
BUNDLE_GEMFILE— Path to application’s gemfile.
BUNDLE_WITHOUT— This variable causes Cloud Foundry to skip installation of gems in excluded groups. Use this with Rails applications, where “assets” and “development” gem groups typically contain gems that are not needed when the app runs in production.
See this blog post for more information.
DATABASE_URL— The Ruby buildpack looks at the
database\_urifor bound services to see if they match known database types. If known relational database services are bound to the application, the buildpack sets up the
DATABASE_URLenvironment variable with the first one in the list.
If your application depends on
DATABASE\_URLbeing set to the connection string for your service, and Cloud Foundry does not set it, you can set this variable manually.
$ cf set-env my_app_name DATABASE_URL mysql://b5d435f40dd2b2:email@example.com:3306/ad_c6f4446532610ab
GEM_HOME— Location where gems are installed.
GEM_PATH— Location where gems can be found.
RACK_ENV— This variable specifies the Rack deployment environment: development, deployment, or none. This governs what middleware is loaded to run the application.
RAILS_ENV— This variable specifies the Rails deployment environment: development, test, or production. This controls which of the environment-specific configuration files will govern how the application will be executed.
RUBYOPT— This Ruby environment variable defines command-line options passed to Ruby interpreter.
RUBYOPT: -I/home/vcap/app/vendor/bundle/ruby/1.9.1/gems/bundler-1.3.2/lib -rbundler/setup