Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Deploying with rbenv
Setting up rbenv on a production server is exactly the same as in development. Some considerations for a hypothetical deployment strategy:
- It is suggested that there is a single user for deployment, e.g. "app" user
RBENV_ROOTis at the default location:
- Ruby versions are either installed or symlinked to
- rbenv version 0.4 or greater is recommended.
Users of Chef or Puppet may find these projects useful:
Ensure consistent PATH for processes
Interactive, non-interactive shells, cron jobs, and similar processes for the "app" user all must ensure that rbenv is present in the PATH:
App bundles and binstubs
The recommended way of using Bundler in production is like so:
bundle install --deployment --binstubs
--binstubs option generates executables in your application's
directory for gems in the bundle.
Read more about binstubs.
Now tools that interact with the app should strictly use the executables in
./bin. For instance, to invoke Unicorn:
Such invocation ensures that:
- The Ruby version for the project is used,
- The Unicorn version of the project's bundle is used.