Forum: Ruby Can't uninstall gems on Ubuntu

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.
E1e2dd8c03c8e9e0680cfd802df0a04b?d=identicon&s=25 Alex 2k8 (alex_2k8)
on 2009-05-27 16:56
Hello,

I installed net-ssh gem from normal account, and got such warnings:

  $ gem install net-ssh
  WARNING:  Installing to ~/.gem since /usr/lib/ruby/gems/1.8 and
            /usr/bin aren't both writable.
  WARNING:  You don't have /home/alex/.gem/ruby/1.8/bin in your PATH,
            gem executables will not run.

To make sure the gem installed:

  $ gem list
  *** LOCAL GEMS ***
  net-ssh (2.0.11, 2.0.10)

Now I try to uninstall it.

  $ gem uninstall net-ssh
  ERROR:  While executing gem ... (Gem::InstallError)
      Unknown gem net-ssh

  $ gem list
  *** LOCAL GEMS ***
  net-ssh (2.0.11, 2.0.10)

So I installed a gem, but can't remove it. What is wrong here?

My system is Ubuntu 8.04,
  $ gem -v
  1.3.1

  $ ruby -v
  ruby 1.8.6 (2007-09-24 patchlevel 111) [i486-linux]

Thanks,
  - Alex
48aef6c74ff21bfe894b201c7936fcdd?d=identicon&s=25 Nation, Carey (Guest)
on 2009-05-27 17:29
(Received via mailing list)
Well, just a couple of guesses here, but:

It installed to your home directory because you don't have write rights
to the system directories. If you have sudo, sudo gem install net-ssh
might have worked.

The second warning on the install probably also tells you why it won't
uninstall.
8f6f95c4bd64d5f10dfddfdcd03c19d6?d=identicon&s=25 Rick Denatale (rdenatale)
on 2009-05-27 19:24
(Received via mailing list)
On Wed, May 27, 2009 at 11:28 AM, Nation, Carey
<Carey.Nation@turner.com> wrote:
> Well, just a couple of guesses here, but:
>
> It installed to your home directory because you don't have write rights
> to the system directories. If you have sudo, sudo gem install net-ssh
> might have worked.
>
> The second warning on the install probably also tells you why it won't
> uninstall.

Actually, I think that it's because gem uninstall defaults to
installing from the system gem directory.

>  WARNING:  Installing to ~/.gem since /usr/lib/ruby/gems/1.8 and
>            /usr/bin aren't both writable.

I suspect that

$gem uninstall -i~/.gem net-ssh

might work.

--
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale
48aef6c74ff21bfe894b201c7936fcdd?d=identicon&s=25 Nation, Carey (Guest)
on 2009-05-27 20:52
(Received via mailing list)
>>Actually, I think that it's because gem uninstall defaults to
>>installing from the system gem directory.

>  WARNING:  Installing to ~/.gem since /usr/lib/ruby/gems/1.8 and
>            /usr/bin aren't both writable.

Sorry for being vague.  That's what I meant, actually.  That is, since
ruby in general couldn't run the gems there as the location wasn't in
the path, it wouldn't be able to uninstall them, either.
E1e2dd8c03c8e9e0680cfd802df0a04b?d=identicon&s=25 Alex 2k8 (alex_2k8)
on 2009-05-27 22:19
> It installed to your home directory because you don't have write rights
> to the system directories. If you have sudo, sudo gem install net-ssh
> might have worked.

Yes, if done with sudo it works fine. But I cann't remove that wrongly
instaled gems :-)

The second warning seems useless, as I have no such folder at all
  /home/alex/.gem/ruby/1.8/bin
E1e2dd8c03c8e9e0680cfd802df0a04b?d=identicon&s=25 Alex 2k8 (alex_2k8)
on 2009-05-27 22:20
> I suspect that
>
> $gem uninstall -i~/.gem net-ssh
>
> might work.

Unsuccessfully it does not :-(
58479f76374a3ba3c69b9804163f39f4?d=identicon&s=25 Eric Hodel (Guest)
on 2009-05-30 17:20
(Received via mailing list)
On May 27, 2009, at 10:56, Alex 2k8 wrote:

>  $ gem list
>  *** LOCAL GEMS ***
>  net-ssh (2.0.11, 2.0.10)
>
> So I installed a gem, but can't remove it. What is wrong here?

Upgrade to 1.3.4, the bug was fixed in the meantime.
This topic is locked and can not be replied to.