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 should differentiate between system and user installed. #470

Closed
envygeeks opened this Issue Feb 25, 2013 · 9 comments

Comments

6 participants
@envygeeks
Copy link

envygeeks commented Feb 25, 2013

gem uninstall minitest -v4.3.2
ERROR:  While executing gem ... (Gem::InstallError)
    gem "minitest" cannot be uninstalled because it is a default gem

When doing gem list I think it would be great if Gem would let a user know if a Gem is a system gem so it doesn't lead to confusion when they try to backtrack and uninstall an older version of a Gem. Maybe something like gem (0.0.2, system: 0.0.1).

@luislavena

This comment has been minimized.

Copy link
Member

luislavena commented Feb 25, 2013

Hello @envygeeks

I think you're confusing system-wide installed gems (sudo gem install) with default gems (those bundled in Ruby)

I think the message is clear, you cannot uninstall minitest because is a default gem.

@envygeeks

This comment has been minimized.

Copy link
Author

envygeeks commented Feb 25, 2013

I'm not confusing anything and regardless of my terminology being different than yours the point stands. I never said the message was not clear, I said it should be clear before somebody tries to uninstall it making it clear, if Gem clearly labeled such things then people would know and would not waste the time trying to uninstall as I did assuming it was the old way.

@luislavena

This comment has been minimized.

Copy link
Member

luislavena commented Feb 25, 2013

@envygeeks wow, slow down, I was pointing out that system as you report is not the same as default reported by RubyGems.

RubyGems 2.0.0 added the difference between default gems (those bundled with Ruby) from normal user or system installed gems.

A clean Ruby installation shows:

$ gem list

*** LOCAL GEMS ***

bigdecimal (1.2.0)
io-console (0.4.2)
json (1.7.7)
minitest (4.3.2)
psych (2.0.0)
rake (0.9.6)
rdoc (4.0.0)
test-unit (2.0.0.0)

And if you check the path to minitest:

$ gem list minitest -d

*** LOCAL GEMS ***

minitest (4.3.2)
    Author: 
    Installed at (default): /Users/luis/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0

    This minitest is bundled with Ruby

Will see that is installed at default.

You can't uninstall default gems, that is bundled with Ruby source package. These gems are part of Ruby own code, if you see:

$ gem which minitest/autorun
/Users/luis/.rbenv/versions/2.0.0-dev/lib/ruby/2.0.0/minitest/autorun.rb

Will notice that the library itself is not installed in the gems directory, like any normal gem.

Now, installing system-wide gems versus user gems is already done properly, either you have or not have permissions, and will tell you.

From your report: Gem should differentiate between system and user installed, is where it gets confusing, since you're stating something about system installed gems and then showing default gems behavior.

Default gems is something that was introduced in RubyGems 2.0 to solve the problem of people uninstalling Ruby-bundled gems and breaking things like rake.

Does it makes sense?

@luislavena

This comment has been minimized.

Copy link
Member

luislavena commented Feb 25, 2013

@drbrain @evanphx do you guys understand the report better than me?

@evanphx

This comment has been minimized.

Copy link
Member

evanphx commented Feb 25, 2013

Yeah, these are special unremovable gems in 1.9/2.0. gem list or something else should indicate where it's from though, that's a good idea.

@luislavena

This comment has been minimized.

Copy link
Member

luislavena commented Feb 25, 2013

@envygeeks you edited the previous comment, is now more clear what you mean.

For the record, RubyGems is volunteer-based effort, so is rubygems.org, please don't be that agressive with people trying to help.

Not everybody speak the same language so usage the same terminology (system versus default) could reduce doubts of what you want from what was understood.

@envygeeks

This comment has been minimized.

Copy link
Author

envygeeks commented Feb 25, 2013

@luislavena o.0 I'm not even gonna get involved in that drama, don't drag me into your war where everybody thinks everybody is out to get them and start a fight or being angry and mean and just hurting everybodies feelings.

That said, @evanphx is right. And to elaborate where I say system substitute it for your "default".

@drbrain

This comment has been minimized.

Copy link
Member

drbrain commented Feb 25, 2013

Seems like a good candidate for a pull request.the relevant code is in Gem::Commands::QueryCommand#entry_versions

@copiousfreetime

This comment has been minimized.

Copy link
Contributor

copiousfreetime commented Jan 29, 2016

To summarize:

  • The suggestion is that the output of gem list should indicate whether a gem is a default gem or a installed gem.
  • The code that should be updated to implement this is Gem::Commands::QueryCommand#entry_versions. Updating #entry_versions will change what is displayed between the (...) in the output of the gem list command.

@bronzdoc bronzdoc self-assigned this Mar 30, 2016

homu added a commit that referenced this issue Mar 30, 2016

Auto merge of #1570 - bronzdoc:show_default_gems, r=duckinator
Show default gems when using "gem list"

closes #470

@homu homu closed this in #1570 Mar 30, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.