[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

RubyGems question: install vs. update

Jeff

4/29/2009 9:16:00 PM

This must be obvious, but what's the difference between "gem install"
and "gem update"?

I would have thought that "gem update" would do a gem install plus a
gem cleanup, effectively updating your current version. But that
doesn't seem to be the case.

Jeff

7 Answers

Eric Hodel

4/29/2009 10:16:00 PM

0

On Apr 29, 2009, at 14:16, Jeff wrote:

> This must be obvious, but what's the difference between "gem install"
> and "gem update"?
>
> I would have thought that "gem update" would do a gem install plus a
> gem cleanup, effectively updating your current version. But that
> doesn't seem to be the case.

gem update will update a named gem if there's a newer version, gem
install will always install.

gem update can update all gems if you don't list any.

Jeff

4/30/2009 1:02:00 AM

0

On Apr 29, 5:16=A0pm, Eric Hodel <drbr...@segment7.net> wrote:
> On Apr 29, 2009, at 14:16, Jeff wrote:
>
> > This must be obvious, but what's the difference between "gem install"
> > and "gem update"?
>
> > I would have thought that "gem update" would do a gem install plus a
> > gem cleanup, effectively updating your current version. =A0But that
> > doesn't seem to be the case.
>
> gem update will update a named gem if there's a newer version, gem =A0
> install will always install.

Hi Eric,

But when I try to update a named gem, I get the new version, but also
still have the old version (if I do gem list I can see both
versions). So maybe I'm missing what you mean by "update" - looks to
me like it simply installed the new one alongside the old one, no
different than if I had done "gem install" to install the latest
version.

I'm currently on RubyGems 1.3.2.

Thanks again,
Jeff

Gregory Brown

4/30/2009 1:40:00 AM

0

On Wed, Apr 29, 2009 at 9:01 PM, Jeff <cohen.jeff@gmail.com> wrote:

> But when I try to update a named gem, I get the new version, but also
> still have the old version (if I do gem list I can see both
> versions). =A0So maybe I'm missing what you mean by "update" - looks to
> me like it simply installed the new one alongside the old one, no
> different than if I had done "gem install" to install the latest
> version.
>
> I'm currently on RubyGems 1.3.2.

RubyGems supports having many versions of a gem installed on the same
system, which is often necessary for dealing with libraries that
depend on a particular version of a project.

The difference between gem update gemname and gem install gemname is
that gem update is essentially a no-op if you already have the latest
gem installed, where gem install will download and install the gem
even if you already have it.

-greg

7stud --

4/30/2009 5:05:00 AM

0

Gregory Brown wrote:
> The difference between gem update gemname and gem install gemname is
> that gem update is essentially a no-op if you already have the latest
> gem installed, where gem install will download and install the gem
> even if you already have it.
>

In addition, if you issue the update command with no filename, for
example:

$ gem update

rubygems will search your local gem directory and update all the gems
contained therein with the latest versions.

If you don't need the old versions, then after either updating or
installing you can use the command

$ gem cleanup

to get rid of the old versions.





--
Posted via http://www.ruby-....

7stud --

4/30/2009 5:07:00 AM

0

7stud -- wrote:
> Gregory Brown wrote:
>> The difference between gem update gemname and gem install gemname is
>> that gem update is essentially a no-op if you already have the latest
>> gem installed, where gem install will download and install the gem
>> even if you already have it.
>>
>
> In addition,
>
...oh, yeah. Sometimes updating doesn't work! For instance, I was
unable to *update* rubygems itself using rubygems. I eventually had to
download the latest version of rubygems and *install* locally.
--
Posted via http://www.ruby-....

Gregory Brown

4/30/2009 5:13:00 AM

0

On Thu, Apr 30, 2009 at 1:04 AM, 7stud -- <bbxx789_05ss@yahoo.com> wrote:
> Gregory Brown wrote:
>> The difference between gem update gemname and gem install gemname is
>> that gem update is essentially a no-op if you already have the latest
>> gem installed, where gem install will download and install the gem
>> even if you already have it.
>>
>
> In addition, if you issue the update command with no filename, for
> example:
>
> $ gem update
>
> rubygems will search your local gem directory and update all the gems
> contained therein with the latest versions.

Read upwards. Eric already let the OP know about this.

Rick DeNatale

4/30/2009 11:28:00 AM

0

On Thu, Apr 30, 2009 at 1:06 AM, 7stud -- <bbxx789_05ss@yahoo.com> wrote:

> ...oh, yeah. =A0Sometimes updating doesn't work! =A0For instance, I was
> unable to *update* rubygems itself using rubygems. =A0I eventually had to
> download the latest version of rubygems and *install* locally.

(sudo) gem update --system

normally works to install the latest version of ruby gems, although it
has been known to fail for certain combinations of old installed, and
new versions.

--=20
Rick DeNatale

Blog: http://talklikeaduck.denh...
Twitter: http://twitter.com/Ri...
WWR: http://www.workingwithrails.com/person/9021-ric...
LinkedIn: http://www.linkedin.com/in/ri...