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

gem install needs --no-user-install #6

Closed
ericgj opened this issue Dec 9, 2013 · 7 comments
Closed

gem install needs --no-user-install #6

ericgj opened this issue Dec 9, 2013 · 7 comments

Comments

@ericgj
Copy link
Contributor

ericgj commented Dec 9, 2013

I don't know if it's due to rbenv or it's the rubygems default nowadays, but I have always needed to gem install foo --no-user-install to get gems to install into .gs . Otherwise they always go into ~/.gem regardless of $GEM_PATH. Am I missing something?

If this is the case, should a line be added to the Readme to this effect?
echo "install: --no-user-install" >> ~/.gemrc is what I did.

@soveran
Copy link
Owner

soveran commented Dec 9, 2013

That's very strange, I don't think that's how rubygems behaves. Do you think you can try without rbenv?

@ericgj
Copy link
Contributor Author

ericgj commented Dec 10, 2013

Works fine without rbenv, it must be the culprit.

@ericgj
Copy link
Contributor Author

ericgj commented Dec 10, 2013

oops. spoke too soon. No, even without rbenv, gem install still puts gems into ~/.gem.

@soveran
Copy link
Owner

soveran commented Dec 10, 2013

What are the values of GS_NAME, GEM_HOME and GEM_PATH before running gem install? Also, what happens if you run this:

$ gs echo GEM_HOME

@ericgj
Copy link
Contributor Author

ericgj commented Dec 10, 2013

It looks ok when in the subshell, but not with gs echo $GEM_HOME (but maybe that's because $GEM_HOME gets evaluated by bash before going into the subshell?)

$ mkdir tmp
$ cd tmp
$ echo $GEM_HOME

$ gs init
$ gs
$ echo $GS_NAME
tmp
$ echo $GEM_HOME
/home/egjertsen/tmp/.gs
$ echo $GEM_PATH
/home/egjertsen/tmp/.gs:/home/egjertsen/.gem/ruby/2.0.0:/usr/lib/ruby/gems/2.0.0
$ exit
$ gs echo $GEM_HOME

Also (not that it's related, but may be related to #4 ), rbenv init gets run again when entering the subshell, duplicating its paths:

$ gs echo $PATH
/home/egjertsen/.rbenv/bin:/home/egjertsen/.gem/ruby/2.0.0/bin:/usr/local/heroku/bin:/home/egjertsen/.rbenv/shims:/home/egjertsen/.rbenv/bin:/home/egjertsen/.gem/ruby/2.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/core_perl

@soveran
Copy link
Owner

soveran commented Dec 19, 2013

I think the problem has to do with rbenv init and not with gs. Maybe it will be worth reporting the issue at the rbenv project, what do you think?

@soveran
Copy link
Owner

soveran commented Dec 19, 2013

I will close this one and refer to #4.

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

2 participants