Created attachment 301551 [details]
Thanks to recent improvements, user gems pretty much work out of the box now but I feel this is the missing piece. It can be frustrating to install a gem, only to find the scripts are not even in your PATH. Of course, we shouldn't mix Ruby versions here so the directory to add should be determined by the eselected Ruby. Please see the attached script. I haven't written a csh version as I am totally clueless about that. :)
I'm not sure this is what every user wants to be enabled by default. I guess I'd put it into /usr/share/docs in one of the next rubygems bumps so that people have it handy to deploy if wished.
Why wouldn't they? The only case where you might not want it is if you want a Portage-installed gem to take priority. But then why would you install it as a user gem in the first place? Keep in mind that rubygems itself prioritises user gems over system gems.
I would love to see this included, too! Makes using user installed gems much more easy, I added this path before anyways!
Sorry for the bump but I've seen people asking why user gems don't show up on the PATH on both StackOverflow and IRC. No doubt many more are just setting this up manually. Could it be reconsidered? I think the point I made above that rubygems itself prioritises user gems over system gems is a significant one.
(In reply to James Le Cuirot from comment #2)
> Why wouldn't they? The only case where you might not want it is if you want
> a Portage-installed gem to take priority. But then why would you install it
> as a user gem in the first place? Keep in mind that rubygems itself
> prioritises user gems over system gems.
I could see the argument that on a server you wouldn't want additional paths configured, especially when they are not actively used, because that could be exploited as an attack vector.
Given that all of this is default rubygems behavior I think I'd be ok with enabling this by default, but it should be easy to turn it off. Perhaps with an option in /etc/conf.d?
Just noticed today that this leaks the RUBY and VERSION variables into the environment so it needs adjusting. I don't care about this any more but other people might.