Reputation: 5952
Let's say my PATH="/usr/bin ... /root/.rbenv/shims"
I have an executable (ruby) in /usr/bin
and /root/.rbenv/shims
. How would I make the ruby in /root/.rbenv/shims
be called?
Upvotes: 5
Views: 7907
Reputation: 360782
Use an absolute path:
$ /root/.rbenv/shims/ruby ...
If you're doing this from a shell script, then use
#!/root/.rbenc/shims/ruby
as the shebang
Upvotes: 1
Reputation: 104080
Put /root/.rbenv/shims
first in your PATH
:
export PATH=/root/.rbenv/SHIMS:$PATH
(Before running this command, you must be sure PATH
already exists -- if it doesn't, it adds the current working directory to your PATH
as well, which is almost always a mistake.)
Upvotes: 11