[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[gem] uninstalling earlier versions

Lionel Thiry

4/21/2005 4:46:00 PM

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....
6 Answers

Chad Fowler

4/21/2005 6:15:00 PM

0

On 4/21/05, Lionel Thiry <lthiryidontwantspam@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://chad...
http://rubyc...
http://ruby...
http://rubygems.rub... (over 300,000 gems served!)



james_b

4/21/2005 6:52:00 PM

0

Chad Fowler wrote:
> On 4/21/05, Lionel Thiry <lthiryidontwantspam@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

4/21/2005 9:09:00 PM

0

Chad Fowler a écrit :
> On 4/21/05, Lionel Thiry <lthiryidontwantspam@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

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

Lionel Thiry

4/21/2005 9:17:00 PM

0

Chad Fowler a écrit :
> On 4/21/05, Lionel Thiry <lthiryidontwantspam@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

--
Lionel Thiry

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

Jim Weirich

4/22/2005 5:56:00 AM

0

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 jim@weirichhouse.org http://onest...
-----------------------------------------------------------------
"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

4/22/2005 2:32:00 PM

0

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?

--
Lionel Thiry

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