You can clone with
HTTPS or Subversion.
I've been trying to build a simple upstart config for a ruby script, but whenever it is run the GEM_HOME and GEM_PATH are empty.
Essentially, I've been trying to su -l -c "echo $GEM_HOME" deploy. I have /etc/profile.d/chruby.sh, and it is being run, and so is the sourced /usr/local/share/chruby/chruby.sh.
su -l -c "echo $GEM_HOME" deploy
I'd be happy to provide any other information. Or maybe it's just obvious as to why this won't work.
Even inside the upstart script block, if I try to source /usr/local/share/chruby/chruby.sh and then chruby 1.9.3-p484 the GEM_HOME/GEM_PATH are empty.
chruby version is 0.3.8
There's several things going on here. First you want to run "echo \$GEM_HOME". Secondly, su -l -c isn't the same as bash -l -c.
su -l -c
bash -l -c
-, -l, --login
Starts the shell as login shell with an environment similar to a
o clears all environment variables except for TERM
o initializes the environment variables HOME, SHELL,
USER, LOGNAME, PATH
o changes to the target user's home directory
o sets argv of the shell to '-' in order to make the
shell a login shell
Although, I'm perplexed as to why calling chruby from within the upstart script doesn't work.