Forum: Ruby gem update results in multiple versions

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F74253f4a099258870157426b4cdb2dc?d=identicon&s=25 davetron5000 (Guest)
on 2008-11-03 02:41
(Received via mailing list)
Working on some code I wish to distribute via gem.  When I up the
version and do a gem update my-code, gem reports that both the
previous version and the new version are installed.  This doesn't seem
to occur with any other gems that I have.  I cannot seem to figure out
what's up with this.

Here's my gemspec:

spec = Gem::Specification.new do |s|
  s.name = "My Proggy"
  s.version = "0.5.3"
  s.author = "David Copeland"
  s.email = "my@email.com"
  s.homepage = "http://www.mystuff.com"
  s.platform = Gem::Platform::RUBY
  s.summary = "Some description"
  s.files = FileList["{bin,lib}/**/*"].to_a
  s.require_path = "lib"
  s.test_files = FileList["{test}/**/test*.rb"].to_a
  s.bindir = "bin"
  s.executables << "cl"
  s.has_rdoc = true
  s.rdoc_options << '--title' << 'Titlet' << '--main' << 'README.rdoc'
  s.extra_rdoc_files = ["README.rdoc"]
end

When I changed from "0.5.3" to "0.5.4", gem just installed it
alongside the old version.  Is there a way to tell it not to do that?

This happened installing the gem from a local .gem file AND from a
remote repository.
40613e55d7082e5f08429dfb50d0680e?d=identicon&s=25 Stefan Lang (Guest)
on 2008-11-03 15:00
(Received via mailing list)
2008/11/3 davetron5000 <davetron5000@gmail.com>:
> Working on some code I wish to distribute via gem.  When I up the
> version and do a gem update my-code, gem reports that both the
> previous version and the new version are installed.  This doesn't seem
> to occur with any other gems that I have.  I cannot seem to figure out
> what's up with this.

It's normal behaviour. It doesn't hurt, since RubyGems
loads the newest version anyway when no specific version
is specified. And the old gem is still there in case another
gem depends on this specific version.

You can uninstall the old version with:

    gem uninstall gem-name -v some.version.number

Stefan
This topic is locked and can not be replied to.