Fix your Ruby environment problems
technotes.iangreenleaf.com
Fix your Ruby environment problems
1–5 of 5 posts
Re: Fix your Ruby environment problems
#2 export PATH=./bin:$PATH
Am I the only one who thinks adding this to your login scripts is a terrible idea?Re: Fix your Ruby environment problems
#3export PATH=./bin:$PATH Am I the only one who thinks adding this to your login scripts is a terrible idea?
To be explicit about why, for others, this means your shell will search for executables in a 'bin' sub directory of whatever directory you happen to be in BEFORE it searches your normal path.
This allows for common commands like 'ls' to be executed from ./bin, if they're present, instead of /bin (from your system).
Once you've done this you've opened yourself up to an attack where you download a zip from the internet, extract it, cd into the directory and type 'ls' and you may have potentially executed something from that zip which you didn't intend to do.
tldr - relative paths in your $PATH is a bad idea.
Re: Fix your Ruby environment problems
#4export PATH=./bin:$PATH Am I the only one who thinks adding this to your login scripts is a terrible idea?
https://github.com/ianheggie/rbenv-binstubs
And the rbenv-gem-rehash plugin:
https://github.com/sstephenson/rbenv-gem-rehash
... and let them take care of setting the local paths, and you never have to generate binstubs manually either. (YMMV, of course, but this works pretty well)
Re: Fix your Ruby environment problems
#5export PATH=./bin:$PATH Am I the only one who thinks adding this to your login scripts is a terrible idea?
No, you're not alone. To be explicit about why, for others, this means your shell will search for executables in a 'bin' sub directory of whatever directory you happen to be in BEFORE it searches your normal path. This allows for common commands like 'ls' to be executed from ./bin, if they're present, instead of /bin (from your system). Once you've done this you've opened yourself up to an attack where you download a…