My context:
- ruby-enterprise 1.8.7, on a CentOS 5
- ruby and gem are installed in /usr/local/bin
- ./runner: runs correctly
sudo ./runner
Rails requires RubyGems >= 1.3.2. Please install RubyGems and try again: http://rubygems.rubyforge.org
(because sudo has a limited PATH)
sudo PATH=$PATH ./runner: runs correctly, as runner has /usr/local/bin in its PATH again
Question:
Are there other alternatives (possibly more elegant - with minimal changes) to launch runner with sudo, when gem is not in /bin or /usr/bin ?
Those I would think of (but not satisfied with):
- putting a symlink to gem in /usr/bin
- modifying runner ?
- modifying sudoers ?
Maybe there is a way with a config file or a command line argument to runner ?