Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 403157 - Script to dynamically add user rubygems bindir to PATH
Summary: Script to dynamically add user rubygems bindir to PATH
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Gentoo Ruby Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-11 11:32 UTC by James Le Cuirot
Modified: 2016-02-02 10:18 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
/etc/profile.d/rubygems-bindir.sh (rubygems-bindir.sh,277 bytes, text/plain)
2012-02-11 11:32 UTC, James Le Cuirot
Details

Note You need to log in before you can comment on or make changes to this bug.
Description James Le Cuirot gentoo-dev 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) archtester gentoo-dev Security 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 gentoo-dev 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 gentoo-dev 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 gentoo-dev Security 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 gentoo-dev 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.