/ruby-buildpack

Cloud Foundry buildpack for Ruby, Sinatra and Rails

Primary LanguageRubyMIT LicenseMIT

Cloud Foundry Ruby Buildpack

CF Slack

A Cloud Foundry buildpack for Ruby based apps.

This is based on the [Heroku buildpack] (https://github.com/heroku/heroku-buildpack-ruby).

Additional information can be found at CloudFoundry.org.

Usage

This buildpack will be used if your app has a Gemfile and Gemfile.lock in the root directory. It will then use Bundler to install your dependencies.

cf push my_app -b https://github.com/cloudfoundry/ruby-buildpack.git

Disconnected environments

To use this buildpack on Cloud Foundry, where the Cloud Foundry instance limits some or all internet activity, please read the Disconnected Environments documentation.

Vendoring app dependencies

As stated in the Disconnected Environments documentation, your application must 'vendor' its dependencies.

For the Ruby buildpack, use bundler:

cd <your app dir>
bundle package --all

cf push uploads your vendored dependencies. The buildpack will compile any dependencies requiring compilation while staging your application.

Building

  1. Make sure you have fetched submodules
git submodule update --init
  1. Get latest buildpack dependencies
BUNDLE_GEMFILE=cf.Gemfile bundle
  1. Build the buildpack
BUNDLE_GEMFILE=cf.Gemfile bundle exec buildpack-packager [ --uncached | --cached ]
  1. Use in Cloud Foundry

    Upload the buildpack to your Cloud Foundry and optionally specify it by name

    cf create-buildpack custom_ruby_buildpack ruby_buildpack-cached-custom.zip 1
    cf push my_app -b custom_ruby_buildpack

Supported binary dependencies

The buildpack only supports the stable patches for each dependency listed in the manifest.yml and releases page.

If you try to use a binary that is not currently supported, staging your app will fail and you will see the following error message:

       Could not get translated url, exited with: DEPENDENCY_MISSING_IN_MANIFEST: ...
 !
 !     exit
 !
Staging failed: Buildpack compilation step failed

Testing

Buildpacks use the Machete framework for running integration tests.

To test a buildpack, run the following command from the buildpack's directory:

BUNDLE_GEMFILE=cf.Gemfile bundle exec buildpack-build

More options can be found on Machete's Github page.

Contributing

Find our guidelines here.

Reporting Issues

Open an issue on this project

Help and Support

Join the #buildpacks channel in our [Slack community] (http://slack.cloudfoundry.org/)

Active Development

The project backlog is on Pivotal Tracker