Iain said:
Is there somewhere I can just add the path hardcoded?
=20
At the top of your app you could do
=20
$LOAD_PATH.unshift ENV['GEM_HOME'] unless $LOAD_PATH.include?=20
ENV['GEM_HOME']
=20
for a nasty workaround.
I shudder less at this
=20
As for how $LOAD_PATH is built: well, it's in ruby.c (look for incpush=20=
and push_include), but the bits you're looking at are probably added = by=20
rubygems.
than at the thought of dealing with C
=20
502 % grep -A1 ryand /etc/sudoers
# Added by ryand:
Defaults env_keep +=3D "GEM_PATH GEM_HOME"
=20
You need to pay attention to where you put that. It HAS to be after =
the reset_env line or it obviously won't work.
I don't have a reset line, but here's my sudoers.
# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the sudoers man page for the details on how to write a sudoers =
file.
#
# Host alias specification
# User alias specification
# Cmnd alias specification
# Defaults specification
Defaults env_keep +=3D "GEM_PATH GEM_HOME"
# Runas alias specification
# User privilege specification
root ALL=3D(ALL) ALL
%admin ALL=3D(ALL) ALL
%iainuser ALL=3D(ALL) ALL
# Uncomment to allow people in group wheel to run all commands
# %wheel ALL=3D(ALL) ALL
# Same thing without a password
# %wheel ALL=3D(ALL) NOPASSWD: ALL
# Samples
# %users ALL=3D/sbin/mount /cdrom,/sbin/umount /cdrom
# %users localhost=3D/sbin/shutdown -h now
=20
=20
=20
btw... are you sure you've exported your env vars?
I used the method Brian Candler suggested in the other mail, but I get =
the same with the one you've used here:
sudo zsh
env
(blah blah blah...)
GEM_HOME=3D/Users/iainuser/.gems
GEM_PATH=3D/Users/iainuser/.gems
sh -c 'echo $GEM_HOME'
/Users/iainuser/.gems
sudo sh -c 'echo $GEM_HOME'
/Users/iainuser/.gems
sudo sh -c 'env'
(blah blah blah...)
GEM_HOME=3D/Users/iainuser/.gems
HOME=3D/Users/iainuser
GEM_PATH=3D/Users/iainuser/.gems
Here's a relevant portion of my zprofile, with recent additions =
included:
export RUBY_PLATFORM=3Ddarwin
export PLATFORM=3D"$RUBY_PLATFORM"
export RUBY_VERSION=3D1.9
export GEM_HOME=3D"$HOME/.gems"
export RUBYLIB=3D"$GEM_HOME"
export GEM_PATH=3D"$GEM_HOME"
export RUBYOPT=3Drubygems
care about configurability, I'm not moving my gems anywhere else soon.
=20
Fix it correctly or don't fix it at all. Anything else is just a = headache delayed.
=20
I agree, but sometimes you just want a headache tablet. Or anything that =
comes on prescription, I hear that's what all the top celebrities are =
doing nowadays. Except for Paris Hilton. Not sure if she counts as a top =
celebrity though. If she'd been caught with several prescriptions I =
might change my mind about her...
Regards,
Iain