Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[gem] uninstalling earlier versions

0 views
Skip to first unread message

Lionel Thiry

unread,
Apr 21, 2005, 12:46:23 PM4/21/05
to
Hello!

I'd like to know if there is any gentle way to uninstall all gems excepted the
latest versions and their depencency.

Thanks in advance
--
Lionel Thiry

Personal website: http://users.skynet.be/lthiry/

Chad Fowler

unread,
Apr 21, 2005, 2:14:37 PM4/21/05
to
On 4/21/05, Lionel Thiry <lthiryido...@skynetnospam.be> wrote:
> Hello!
>

Hi!

> I'd like to know if there is any gentle way to uninstall all gems excepted the
> latest versions and their depencency.
>
> Thanks in advance
>

$ gem cleanup

You'll need a fairly recent version of RubyGems. This was added
within the past couple of months.

--

Chad Fowler
http://chadfowler.com
http://rubycentral.org
http://rubygarden.org
http://rubygems.rubyforge.org (over 300,000 gems served!)

James Britt

unread,
Apr 21, 2005, 2:51:41 PM4/21/05
to
Chad Fowler wrote:
> On 4/21/05, Lionel Thiry <lthiryido...@skynetnospam.be> wrote:
>
>>Hello!
>>
>
>
> Hi!
>
>
>>I'd like to know if there is any gentle way to uninstall all gems excepted the
>>latest versions and their depencency.
>>
>>Thanks in advance
>>
>
>
> $ gem cleanup
>
> You'll need a fairly recent version of RubyGems. This was added
> within the past couple of months.
>

Ah. Nice. SO I go and try it out, and mistype the command.

Yet it runs:

c:\>gem cl;eanup
Cleaning up installed gems...
Clean Up Complete


I see that one can abbreviate this, and I guess the trailing characters
were enough to stop it from actually running, because I then tried this:

c:\>gem cl
Cleaning up installed gems...
Attempting uninstall on rails-0.11.1
Attempting to uninstall gem 'rails'
Successfully uninstalled rails version 0.11.1
Attempting uninstall on mechanize-0.1.0
Attempting to uninstall gem 'mechanize'
Successfully uninstalled mechanize version 0.1.0
Attempting uninstall on nitro-0.14.0
Attempting to uninstall gem 'nitro'
Successfully uninstalled nitro version 0.14.0
Attempting uninstall on madeleine-0.6.1
Attempting to uninstall gem 'madeleine'
Successfully uninstalled madeleine version 0.6.1
Attempting uninstall on htmltools-1.0.8
Attempting to uninstall gem 'htmltools'
..


Wondering if 'cl' was a formal abbreviation for 'cleanup', I ran

C:\Temp>gem help cl
Usage: gem cleanup [options]

Options:
-d, --dryrun
..


But this works, too:

C:\Temp>gem help cle
Usage: gem cleanup [options]

Options:
-d, --dryrun
..


Does this willingness to interpret partial commands pose a risk if the
command is destructive? It is unlikely I would accidentally type "gem
cleanup", but "gem cl" seems plausible.


Might it be better to require complete command names on destructive
operations?

James

Lionel Thiry

unread,
Apr 21, 2005, 5:08:55 PM4/21/05
to
Chad Fowler a écrit :

> On 4/21/05, Lionel Thiry <lthiryido...@skynetnospam.be> wrote:
>
>>Hello!
>>
>
>
> Hi!
>
>
>>I'd like to know if there is any gentle way to uninstall all gems excepted the
>>latest versions and their depencency.
>>
>>Thanks in advance
>>
>
>
> $ gem cleanup
>
> You'll need a fairly recent version of RubyGems. This was added
> within the past couple of months.
>

Thanks!

But I had some warnings:

---8<---
Attempting uninstall on rubyzip-0.5.5
Attempting to uninstall gem 'rubyzip'

You have requested to uninstall the gem:
rubyzip-0.5.5
instiki-0.10.0 depends on [rubyzip (= 0.5.5)]
instiki-0.9.2 depends on [rubyzip (= 0.5.5)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn]
Successfully uninstalled rubyzip version 0.5.5
---8<---

and

---8<---


Attempting uninstall on rails-0.11.1
Attempting to uninstall gem 'rails'

You have requested to uninstall the gem:
rails-0.11.1
instiki-0.10.0 depends on [rails (= 0.11.1)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn]
---8<---

I've said yes to both, but I don't know if it is a mistake or not. Can you tell
me more about this?

Lionel Thiry

unread,
Apr 21, 2005, 5:16:46 PM4/21/05
to
Chad Fowler a écrit :

> On 4/21/05, Lionel Thiry <lthiryido...@skynetnospam.be> wrote:
>
>>Hello!
>>
>
>
> Hi!
>
>
>>I'd like to know if there is any gentle way to uninstall all gems excepted the
>>latest versions and their depencency.
>>
>>Thanks in advance
>>
>
>
> $ gem cleanup
>
> You'll need a fairly recent version of RubyGems. This was added
> within the past couple of months.
>

Thanks a lot!

I had some warnings:

---8<---
Attempting uninstall on rubyzip-0.5.5
Attempting to uninstall gem 'rubyzip'

You have requested to uninstall the gem:
rubyzip-0.5.5
instiki-0.10.0 depends on [rubyzip (= 0.5.5)]
instiki-0.9.2 depends on [rubyzip (= 0.5.5)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn]

---8<---

and

---8<---
Attempting uninstall on rails-0.11.1
Attempting to uninstall gem 'rails'

You have requested to uninstall the gem:
rails-0.11.1
instiki-0.10.0 depends on [rails (= 0.11.1)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn]
---8<---

I've said yes to both but I have no idea if it was the thing to do.

PS: my first post didn't succeed, this is a retry, there may be a double posting

Jim Weirich

unread,
Apr 22, 2005, 1:56:10 AM4/22/05
to
On Thursday 21 April 2005 05:14 pm, Lionel Thiry wrote:
> ---8<---

> You have requested to uninstall the gem:
> rails-0.11.1
> instiki-0.10.0 depends on [rails (= 0.11.1)]
> If you remove this gems, one or more dependencies will not be met.
> Continue with Uninstall? [Yn]
> ---8<---
>
> I've said yes to both but I have no idea if it was the thing to do.

Your version of instiki requires version 0.11.1 of rails. You presumably have
version 0.11.1 and a later version installed. The cleanup command wants to
remove 0.11.1 (since you have a later version), but the instiki program
cannot use the later version (because it explicitly says = 0.11.1). Removing
rails 0.11.1 will probably cause instiki to fail.

--
-- Jim Weirich j...@weirichhouse.org http://onestepback.org
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)


Lionel Thiry

unread,
Apr 22, 2005, 10:31:51 AM4/22/05
to
Jim Weirich a écrit :

> On Thursday 21 April 2005 05:14 pm, Lionel Thiry wrote:
>
>>---8<---
>>You have requested to uninstall the gem:
>> rails-0.11.1
>>instiki-0.10.0 depends on [rails (= 0.11.1)]
>>If you remove this gems, one or more dependencies will not be met.
>>Continue with Uninstall? [Yn]
>>---8<---
>>
>>I've said yes to both but I have no idea if it was the thing to do.
>
>
> Your version of instiki requires version 0.11.1 of rails. You presumably have
> version 0.11.1 and a later version installed. The cleanup command wants to
> remove 0.11.1 (since you have a later version), but the instiki program
> cannot use the later version (because it explicitly says = 0.11.1). Removing
> rails 0.11.1 will probably cause instiki to fail.
>

Mmm, so I made a mistake.

But well, shouldn't the "n" anwser be the default? Who wants to break
dependencies? I personnaly didn't want it.

And is it really necessary to ask such a question? I mean, if one really wants
to remove a gem, action which could break depencies, wouldn't it be better for
him to explicitly force it? With something like:

gem unsinstall --force the_gem_I_really_want_to_remove

No? What do you think about it?

0 new messages