Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignoring ~/.gemrc options #24

Open
jpcirrus opened this issue Aug 30, 2014 · 5 comments
Open

ignoring ~/.gemrc options #24

jpcirrus opened this issue Aug 30, 2014 · 5 comments

Comments

@jpcirrus
Copy link

specific_install 0.2.11, ruby 2.0.0, os x 10.9.4:

When installing with say sudo gem specific_install -l https://github.com/hisashim/docdiff.git the options specified in the ~/.gemrc are ignored. But when using sudo gem install docdiff the options in ~/.gemrc are applied.

@zph
Copy link
Collaborator

zph commented Aug 30, 2014

Interesting. Thanks for using specific_install and for reporting this issue 🐱.

I wonder if gem-install does a lookup to check whether it's running under sudo and then reaches back for the user's ~/.gemrc.

What's the result of your gemrc being ignored? Is it settings such as --no-ri --no-rdoc ?

@jpcirrus
Copy link
Author

My ~/.gemrc is:

install: --bindir /usr/local/bin --no-prerelease --no-document --env-shebang
update:  --bindir /usr/local/bin --no-prerelease --no-document --env-shebang

What's happening is that the scripts are being installed into /usr/bin and their shebang is /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby instead of /usr/bin/env ruby which means my updated ruby in /usr/local/bin is not being used. Not the end of the world as I am moving and editing them as required -- just means I have to think a bit :)

@rdp
Copy link
Owner

rdp commented Aug 30, 2014

yikes is there even a work around? Can it even know who the calling user
was before it entered sudo land?
Maybe you can put options in something equivalent to /etc/gemrc or some odd?

On Sat, Aug 30, 2014 at 4:44 AM, John Purnell [email protected]
wrote:

specific_install 0.2.11, ruby 2.0.0, os x 10.9.4:

When installing with say sudo gem specific_install -l
https://github.com/hisashim/docdiff.git the options specified in the
~/.gemrc are ignored. But when using sudo gem install docdiff the options
in ~/.gemrc are applied.


Reply to this email directly or view it on GitHub
#24.

@jpcirrus
Copy link
Author

The global file is unfortunately system dependant:

[src]$ irb
irb(main):001:0> require 'rubygems'
=> false
irb(main):002:0> Gem::ConfigFile::SYSTEM_WIDE_CONFIG_FILE
=> "/Library/Ruby/Site/gemrc"

I don't know how rubygems is getting the correct ~/.gemrc but when I do:

[src]$ sudo echo $USER
[sudo] jp@JP-MBP's password:
jp

the correct user id is returned.

@skull-squadron
Copy link
Contributor

Same issue here.

---
gem: --no-document

and it seems to always builds docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants