install-command doesn't seem to honor gemrc #666

Closed
Mon-Ouie opened this Issue Jul 25, 2012 · 8 comments

Comments

Projects
None yet
3 participants
@Mon-Ouie
Member

Mon-Ouie commented Jul 25, 2012

Using the following gemrc file:

gem: --user-install

install-command still tries to install gems in the system directory, unlike gem install.

@sent-hil

This comment has been minimized.

Show comment
Hide comment
@sent-hil

sent-hil Nov 20, 2012

I think it's because Gem::DependencyInstaller.new link which used to install the gem within pry doesn't take into consideration gemrc files.

One idea is to use Gem::ConfigFile.new link to get/parse .gemrc files and manually set the gempath from that to DependencyInstaller. Of course we could parse it manually since it's just an yaml file, but this seems easier.

Suggestions/comments?

I think it's because Gem::DependencyInstaller.new link which used to install the gem within pry doesn't take into consideration gemrc files.

One idea is to use Gem::ConfigFile.new link to get/parse .gemrc files and manually set the gempath from that to DependencyInstaller. Of course we could parse it manually since it's just an yaml file, but this seems easier.

Suggestions/comments?

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Nov 20, 2012

@sent-hil Yes, that sounds like a good approach. FWIW DependencyInstaller accepts many options, one being install_dir & another being user_install. I think we want to hook into user_install.

ghost commented Nov 20, 2012

@sent-hil Yes, that sounds like a good approach. FWIW DependencyInstaller accepts many options, one being install_dir & another being user_install. I think we want to hook into user_install.

@sent-hil

This comment has been minimized.

Show comment
Hide comment
@sent-hil

sent-hil Nov 20, 2012

@robgleeson cool, will use that. Should I assume gempath option in .gemrc accepts only one path? I see some examples online with multiple paths, not sure how to handle that.

@Mon-Ouie Could you post your .gemrc?

@robgleeson cool, will use that. Should I assume gempath option in .gemrc accepts only one path? I see some examples online with multiple paths, not sure how to handle that.

@Mon-Ouie Could you post your .gemrc?

@sent-hil

This comment has been minimized.

Show comment
Hide comment
@sent-hil

sent-hil Nov 20, 2012

https://github.com/sent-hil/pry/commit/a848d62f115fa06e2246895269c70d44f7187d95 : this works, but I don't like the doubles ifs.

Also, there're no tests for gem-install?

https://github.com/sent-hil/pry/commit/a848d62f115fa06e2246895269c70d44f7187d95 : this works, but I don't like the doubles ifs.

Also, there're no tests for gem-install?

@sent-hil

This comment has been minimized.

Show comment
Hide comment
@sent-hil

sent-hil Nov 20, 2012

@kyrylo Err, I think I read the bug report wrong. I assumed gempath was specified in .gemrc and gem-install was ignoring that. Will see how --user-install is being used by rubygems.

@kyrylo Err, I think I read the bug report wrong. I assumed gempath was specified in .gemrc and gem-install was ignoring that. Will see how --user-install is being used by rubygems.

@sent-hil

This comment has been minimized.

Show comment
Hide comment
@sent-hil

sent-hil Nov 20, 2012

Can I get a code review on this? https://github.com/sent-hil/pry/commit/c58ad08cd4fd2150a2b7a56e9fad284afb8aea33

If someone knows a better way to do last spec, we can remove the minitest depedency.

Thanks!

Can I get a code review on this? https://github.com/sent-hil/pry/commit/c58ad08cd4fd2150a2b7a56e9fad284afb8aea33

If someone knows a better way to do last spec, we can remove the minitest depedency.

Thanks!

@kyrylo

This comment has been minimized.

Show comment
Hide comment
@kyrylo

kyrylo Jan 24, 2013

Member

@sent-hil, you shouldn't have deleted your repository.

Member

kyrylo commented Jan 24, 2013

@sent-hil, you shouldn't have deleted your repository.

@ghost ghost assigned kyrylo Jan 24, 2013

kyrylo added a commit that referenced this issue Feb 20, 2013

Command::InstallCommand: honor ".gemrc" switches
Fix issue #666 (install-command doesn't seem to honor gemrc)

Also, prettify various messages from "install-command".

@kyrylo kyrylo closed this Feb 20, 2013

kyrylo added a commit that referenced this issue Feb 23, 2013

Command::InstallCommand: honor ".gemrc" switches
Fix issue #666 (install-command doesn't seem to honor gemrc)

Also, prettify various messages from "install-command".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment