Note: This guide uses the Cloud Foundry CLI version 5. The instructions below are not compatible with any cf version > 5. Click here to get a description of the differences between CLI v5 and CLI v6.
Anynines allows the usage of different buildpacks to support multiple application environments. Please find the latest Ruby buildpack in the designated Cloud Foundry’s repository. For more information on buildpacks please refer to the official Cloud Foundry documentation.
We need to specify a buildpack to support Rails 4 and Ruby 2.0 when deploying applications to anynines.com. To showcase how to do this exactly, we created an example application using Rails 4 and Ruby 2.0 as a reference. You can find the source code for the example app on GitHub.
To deploy our sample application:
1. Install the a9s gem and login (if you haven’t already)
$> gem install a9s
2. Switch to your desired space (e.g. production)
$> cf target -s production
3. Clone the example application repository
$> git clone https://github.com/anynines/rails4ruby2example.git $> cd rails4ruby2example
4. Adjust the deployment manifest.yml
$> cp manifest.yml.example manifest.yml $> open manifest.yml
5. Exchange all occurences of “your_app_name” with your application’s name
6. Deploy the application
$> cf push
7. Visit the displayed application url and try and create a post
You can choose a buildpack manually by specifying it's url on the command line like this:
$> cf push --buildpack https://github.com/heroku/heroku-buildpack-ruby.git
Please sign in to leave a comment.