VOOZH about

URL: http://rvm.io/deployment/init-d

⇱ RVM: Ruby Version Manager - RVM and Ruby-based services started with init.d or upstart


👁 RVM Logo
Support
RVM is maintained by community of volunteers, report issues to RVM issues tracker.
If you can help or wish to become one of the maintainers - just start helping. You can find more RVM related projects at RVM Github organization.
Donation
Love RVM? Help us maintain RVM, a donation can help with it. Want to help in other way, want to be a sponsor?
contact: Michal Papis
Sponsors
👁 Fastly
Carbon Ads

Using RVM and Ruby-based services that start via init.d or upstart

To use any Ruby application that needs to be started with init.d or upstart (e.g., god, unicorn, thin) with RVM, you need to generate a wrapper script. Namely, you need to set it up so that there is an alternative executable that loads the correct ruby and gems environment (run this in your shell):

rvm alias create my_app ruby-2.0.0-p247@my_app
# rvm wrapper my_app --no-links unicorn_rails # only for RVM 1.24 and older

This will generate a wrapper that can be referenced in the init.d script or in upstart configuration:

/usr/local/rvm/wrappers/my_app/unicorn_rails

Where:

  • /usr/local/rvm - is echo $rvm_path
  • wrappers - is static always the same
  • my_app - is the alias name
  • unicorn_rails - is the command that is being wrapped

Example scripts:

RVM Documentation Index | RVM Blog
RVM Interpreters Rubies
Gemsets Set Actions Workflow Deployment
Integration
Packages Presentations Help & Support Quality Assurance Development Credits
∞ Copyright © 2009-2011 Wayne E. Seguin © 2011-2017 Michal Papis © 2016-2017 Piotr Kuczynski ∞ Built with Nanoc ∞ Cached by Fastly ∞ Tested by Travis CI