0

I have a simple Thin webserver I want to start with Upstart. However, upstart needs to be run with sudo which can't see all the RVM gems like Thin. rvmsudo hasn't helped me either. What's the solution for upstart to see your RVM gems?

joslinm
  • 7,845
  • 6
  • 49
  • 72
  • 1
    RVM is really more for personal use. For a system service, I would just install the version of Ruby you want (someplace that doesn't conflict with the system version, like /usr/local/) and use Bundler in deployment mode to get the gemset. – Mark Reed Nov 20 '12 at 13:05
  • Gotcha. Thanks, I wasn't aware of deployment mode. – joslinm Nov 20 '12 at 18:45
  • http://stackoverflow.com/questions/3230404/rvm-and-thin-root-vs-local-user – zuba Feb 26 '13 at 12:46

2 Answers2

1

RVM is really more for personal use. For a system service, I would just install the version of Ruby you want (someplace that doesn't conflict with the system version, like /usr/local/) and use Bundler in deployment mode to get the gemset.

Mark Reed
  • 91,912
  • 16
  • 138
  • 175
  • 2
    Why should RVM differentiate between personal and production use? System ruby is normally broken and/or outdated - And I almost never have a smooth setup with it. – TJ Biddle Oct 22 '13 at 23:52
  • @TJBiddle RVM builds ruby meaning your production build time just increased, not to mention now you have build tools on your production servers, which is usually frowned upon for security reasons. Having static binary with your specific ruby version will be faster and more consistent. – nictrix Jun 17 '14 at 05:44
0

Have you considered creating a gemset and defaulting to a particular gemset for your project?

  1. Default to a Ruby: rvm use 1.9.3
  2. Create a Gemset Manually (One time): rvm gemset create project-name
  3. Switch to this Gemset: rvm gemset use project-name

See if this works, you might be able to later on add this to your .rvmrc file for automatic context switching. But give it a shot first and see if this works.

Jasdeep Singh
  • 3,276
  • 4
  • 28
  • 47
  • Thanks, but the problem remains the same -- upstart needs sudo permissions to run & therefore the home directory changes affecting rvm. – joslinm Nov 20 '12 at 06:08