So I'm trying to get thin to run as a service with RVM. After a thin install
I manually updated /etc/init.d/thin
to use an su - user
when running the config command so that thin was running as a local user, rather than root. So far so good.
Now, when I try to sudo service thin start
it looks like it's trying to use the non-RVM version of Ruby (1.8.7 which was installed on the box to start with) to actually execute the command. I did a gem install thin
on the non-RVM version, which then gets me a uninitialized constant Bundler
message—Bundler is only installed in the RVM gems, not the system gems. It looks like I can't get the RVM environment set up (even though my RVM startup script is in ~/.bashrc which is then included in ~/.bash_profile).
All I want to do is run thin as a service using the RVM environment, not the system environment. Is this even possible? Should I just give up and commit the ultimate sin of running everything as root? It's very tempting at this point.
Thanks for any help!