|Summary:||Script to dynamically add user rubygems bindir to PATH|
|Product:||Gentoo Linux||Reporter:||James Le Cuirot <chewi>|
|Component:||[OLD] Development||Assignee:||Gentoo Ruby Team <ruby>|
|Severity:||enhancement||CC:||candrews, peach, ph03|
|Package list:||Runtime testing required:||---|
Description James Le Cuirot 2012-02-11 11:32:08 UTC
Created attachment 301551 [details] /etc/profile.d/rubygems-bindir.sh 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. :)
Comment 1 Alex Legler (RETIRED) 2012-02-14 11:47:18 UTC
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.
Comment 2 James Le Cuirot 2012-02-14 12:01:37 UTC
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.
Comment 3 Janick Martinez Esturo 2013-04-09 20:11:08 UTC
I would love to see this included, too! Makes using user installed gems much more easy, I added this path before anyways!
Comment 4 James Le Cuirot 2013-08-28 06:51:24 UTC
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.
Comment 5 Hans de Graaff 2013-08-28 15:15:42 UTC
(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?
Comment 6 James Le Cuirot 2016-02-02 10:18:39 UTC
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.