Permalink
Fetching contributors…
Cannot retrieve contributors at this time
64 lines (56 sloc) 3.29 KB
---
title: Environment Variables Defined by the Ruby Buildpack
owner: Buildpacks
---
<%=vars.product_full%> 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 <%=vars.product_full%>, see the [Cloud Foundry Environment Variables](../../devguide/deploy-apps/environment-variable.html) topic.
## Ruby Buildpack Environment Variables ##
The following table describes the environment variables provided by the Ruby buildpack.
<table border="1" class="nice" >
<tr>
<th>Environment Variable</th>
<th>Description</th>
</tr>
<tr>
<td><code>BUNDLE_BIN_PATH</code></td>
<td>The directory where Bundler installs binaries. Example: <code>BUNDLE_BIN_PATH:/home/vcap/app/vendor/bundle/ruby/1.9.1/gems/bundler-1.3.2/bin/bundle</code></td>
</tr>
<tr>
<td><code>BUNDLE_GEMFILE</code></td>
<td>The path to the Gemfile for the app. Example: <code>BUNDLE_GEMFILE:/home/vcap/app/Gemfile</code></td>
</tr>
<tr>
<td><code>BUNDLE_WITHOUT</code></td>
<td>Instructs Cloud Foundry to skip gem installation 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. Example: <code>BUNDLE_WITHOUT=assets</code>
</td>
</tr>
<tr>
<td><code>DATABASE_URL</code></td>
<td>Cloud Foundry examines the <code>database_uri</code> for bound services to see if they match known database types. If known relational database services are bound to the app, then the <code>DATABASE_URL</code> environment variable is set to the first services in the list.
<br><br>
If your application requires that <code>DATABASE_URL</code> is set to the connection string for your service, and Cloud Foundry does not set it, use the Cloud Foundry Command Line Interface (cf CLI) <code>cf set-env</code> command to set this variable manually. Example: <pre class='terminal'>$ cf set-env my-app DATABASE_URL mysql://example-database-connection-string</pre></td>
</tr>
<tr>
<td><code>GEM_HOME</code></td>
<td>The directory where gems are installed. Example: <code>GEM_HOME:/home/vcap/app/vendor/bundle/ruby/1.9.1</code></td>
</tr>
<tr>
<td><code>GEM_PATH</code></td>
<td>The directory where gems can be found. Example: <code>GEM_PATH=/home/vcap/app/vendor/bundle/ruby/1.9.1:</code></td>
</tr>
<tr>
<td><code>RACK_ENV</code></td>
<td>The Rack deployment environment, which governs the middleware loaded to run the app. Valid value are <code>development</code>, <code>deployment</code>, and <code>none</code>. Example: <code>RACK_ENV=none</code></td>
</tr>
<tr>
<td><code>RAILS_ENV</code></td>
<td>The Rails deployment environment, which controls which environment-specific configuration file governs how the app is executed. Valid value are <code>development</code>, <code>test</code>, and <code>production</code>. Example: <code>RAILS_ENV=production</code></td>
</tr>
<tr>
<td><code>RUBYOPT</code></td>
<td>Defines command-line options
passed to Ruby interpreter. Example: <code>RUBYOPT: -I/home/vcap/app/vendor/bundle/ruby/1.9.1/gems/bundler-1.3.2/lib -rbundler/setup</code></td>
</tr>
</table>