# Wtf? gem command vanished

**URL:** <https://rubytalk.org/t/wtf-gem-command-vanished/41335>\
**Category:** ruby-talk\
**Created:** [12 October 2007 06:25 UTC](https://rubytalk.org/t/wtf-gem-command-vanished/41335 "2007-10-12T06:25:55Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giles\_Bowkett](https://avatars.discourse-cdn.com/v4/letter/g/96bed5/32.png) [@Giles\_Bowkett](https://rubytalk.org/u/Giles_Bowkett)\
**Post date:** [12 October 2007 06:25 UTC](https://rubytalk.org/t/wtf-gem-command-vanished/41335/1 "2007-10-12T06:25:55Z")

</div>

Did gems change significantly recently? If not, my computer went nuts.

> **···**
>
> --  
> Giles Bowkett
> 
> Blog: [http://gilesbowkett.blogspot.com](http://gilesbowkett.blogspot.com)  
> Portfolio: [http://www.gilesgoatboy.org](http://www.gilesgoatboy.org)  
> Tumblelog: [http://giles.tumblr.com/](http://giles.tumblr.com/)

---

<div class="post-metadata">

**Author:** ![James\_Britt](https://avatars.discourse-cdn.com/v4/letter/j/22d042/32.png) [@James\_Britt](https://rubytalk.org/u/James_Britt)\
**Post date:** [12 October 2007 08:54 UTC](https://rubytalk.org/t/wtf-gem-command-vanished/41335/2 "2007-10-12T08:54:30Z")

</div>

Check your PATH  
Install anything recently that likes to change the path ? (python for example or other command line tools?)

> **···**
>
> On Oct 12, 2007, at 1:25 AM, Giles Bowkett wrote:
> 
> > Did gems change significantly recently? If not, my computer went nuts.
> > 
> > -- Giles Bowkett
> > 
> > Blog: [http://gilesbowkett.blogspot.com](http://gilesbowkett.blogspot.com)  
> > Portfolio: [http://www.gilesgoatboy.org](http://www.gilesgoatboy.org)  
> > Tumblelog: [http://giles.tumblr.com/](http://giles.tumblr.com/)

---

<div class="post-metadata">

**Author:** ![Eric\_Hodel1](https://avatars.discourse-cdn.com/v4/letter/e/a9adbd/32.png) [@Eric\_Hodel1](https://rubytalk.org/u/Eric_Hodel1)\
**Post date:** [12 October 2007 15:55 UTC](https://rubytalk.org/t/wtf-gem-command-vanished/41335/3 "2007-10-12T15:55:13Z")

</div>

Check your PATH, `gem` doesn't delete itself.

> **···**
>
> On Oct 11, 2007, at 23:25 , Giles Bowkett wrote:
> 
> > Did gems change significantly recently? If not, my computer went nuts.
> 
> --  
> Poor workers blame their tools. Good workers build better tools. The  
> best workers get their tools to do the work for them. -- Syndicate Wars

---

<div class="post-metadata">

**Author:** ![James\_Britt](https://avatars.discourse-cdn.com/v4/letter/j/22d042/32.png) [@James\_Britt](https://rubytalk.org/u/James_Britt)\
**Post date:** [12 October 2007 09:16 UTC](https://rubytalk.org/t/wtf-gem-command-vanished/41335/4 "2007-10-12T09:16:51Z")

</div>

BTW, Giles, I know you run OS X, so it is probably your path getting mucked up by either an installation of something, or a software update of some kind. I've had it happen and seen it on the list at least once a week lately.  
There seem to be two schools of thought out there for setting paths in OS X, the "python school" and the "ruby school"  
basically, one camp likes to use a different dot file in the home directory and the other camp likes to use another dot file.  
In the python world, they seem to want to add a .bash\_profile when installing, rather than checking to see what you are already using.  
In the ruby world we tend to use the .bash\_login for OS X.  
there is also the possibility of a .bashrc  
You're better off having only one of those, you'll likely know which one is the culprit by looking at the mtime (modified time) on the file in the file system.  
open it and your usual path setting dot file, and adjust to fit your original scheme.

I can only guess that by creating another dot file, they're trying not to gum up your existing path, but that could be respected by commenting it out and appending the file with the new path...

When adjusting the dot files and paths, don't forget to comment them so you know why and what you changed later!

> **···**
>
> On Oct 12, 2007, at 3:54 AM, John Joyce wrote:
> 
> > On Oct 12, 2007, at 1:25 AM, Giles Bowkett wrote:
> > 
> > > Did gems change significantly recently? If not, my computer went nuts.
> > > 
> > > -- Giles Bowkett
> > > 
> > > Blog: [http://gilesbowkett.blogspot.com](http://gilesbowkett.blogspot.com)  
> > > Portfolio: [http://www.gilesgoatboy.org](http://www.gilesgoatboy.org)  
> > > Tumblelog: [http://giles.tumblr.com/](http://giles.tumblr.com/)
> > 
> > Check your PATH  
> > Install anything recently that likes to change the path ? (python for example or other command line tools?)

---

<div class="post-metadata">

**Author:** ![Luu\_Trung](https://avatars.discourse-cdn.com/v4/letter/l/85f322/32.png) [@Luu\_Trung](https://rubytalk.org/u/Luu_Trung)\
**Post date:** [12 October 2007 15:05 UTC](https://rubytalk.org/t/wtf-gem-command-vanished/41335/5 "2007-10-12T15:05:11Z")

</div>

John Joyce wrote:

> **···**
>
> > On Oct 12, 2007, at 1:25 AM, Giles Bowkett wrote:
> > 
> > > Did gems change significantly recently? If not, my computer went nuts.
> > > 
> > > --  
> > > Giles Bowkett
> > > 
> > > Blog: [http://gilesbowkett.blogspot.com](http://gilesbowkett.blogspot.com)  
> > > Portfolio: [http://www.gilesgoatboy.org](http://www.gilesgoatboy.org)  
> > > Tumblelog: [http://giles.tumblr.com/](http://giles.tumblr.com/)
> > 
> > Check your PATH  
> > Install anything recently that likes to change the path ? (python for  
> > example or other command line tools?)
> 
> Luu Trung Hieu
> 
> Attachments:  
> [http://www.ruby-forum.com/attachment/636/add.txt](http://www.ruby-forum.com/attachment/636/add.txt)
> 
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![a11](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/a11/32/8169_2.png) [@a11](https://rubytalk.org/u/a11)\
**Post date:** [12 October 2007 16:04 UTC](https://rubytalk.org/t/wtf-gem-command-vanished/41335/6 "2007-10-12T16:04:20Z")

</div>

can we add that feature though?

a @ [http://codeforpeople.com/](http://codeforpeople.com/)

> **···**
>
> On Oct 12, 2007, at 9:55 AM, Eric Hodel wrote:
> 
> > Check your PATH, `gem` doesn't delete itself.
> 
> --  
> share your knowledge. it's a way to achieve immortality.  
> h.h. the 14th dalai lama

---

<div class="post-metadata">

**Author:** ![a11](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/a11/32/8169_2.png) [@a11](https://rubytalk.org/u/a11)\
**Post date:** [12 October 2007 13:57 UTC](https://rubytalk.org/t/wtf-gem-command-vanished/41335/7 "2007-10-12T13:57:30Z")

</div>

and in my world they are all them same - you just have to guard them in order to make them re-entrant. safest thing on osx - the dotfile semantics there are weird...

a @ [http://codeforpeople.com/](http://codeforpeople.com/)

> **···**
>
> On Oct 12, 2007, at 3:16 AM, John Joyce wrote:
> 
> > In the python world, they seem to want to add a .bash\_profile when installing, rather than checking to see what you are already using.  
> > In the ruby world we tend to use the .bash\_login for OS X.  
> > there is also the possibility of a .bashrc
> 
> --  
> it is not enough to be compassionate. you must act.  
> h.h. the 14th dalai lama

---

<div class="post-metadata">

**Author:** ![Eric\_Hodel1](https://avatars.discourse-cdn.com/v4/letter/e/a9adbd/32.png) [@Eric\_Hodel1](https://rubytalk.org/u/Eric_Hodel1)\
**Post date:** [12 October 2007 16:30 UTC](https://rubytalk.org/t/wtf-gem-command-vanished/41335/8 "2007-10-12T16:30:38Z")

</div>

An uninstaller for RubyGems? Yes, but I have no interest in writing it now.

> **···**
>
> On Oct 12, 2007, at 09:04 , ara.t.howard wrote:
> 
> > On Oct 12, 2007, at 9:55 AM, Eric Hodel wrote:
> > 
> > > Check your PATH, `gem` doesn't delete itself.
> > 
> > can we add that feature though?
> 
> --  
> Poor workers blame their tools. Good workers build better tools. The  
> best workers get their tools to do the work for them. -- Syndicate Wars

---

<div class="post-metadata">

**Author:** ![Giles\_Bowkett](https://avatars.discourse-cdn.com/v4/letter/g/96bed5/32.png) [@Giles\_Bowkett](https://rubytalk.org/u/Giles_Bowkett)\
**Post date:** [12 October 2007 15:01 UTC](https://rubytalk.org/t/wtf-gem-command-vanished/41335/9 "2007-10-12T15:01:15Z")

</div>

It's true, I did mess around with my PATH the other day. I was going  
nuts trying to install lejos, which is the Java API and VM for Lego  
Mindstorms robots. But the weird thing is that I reverted the changes  
in my .profile (to add to the list of dot files) and gem's still  
invisible to bash.

I think something went wrong with gem itself. I'm expecting it to be  
in /opt/local/bin/gem, but it isn't there. The output from locate gem  
is absurd overkill, but maybe a long-running find.

> **···**
>
> --  
> Giles Bowkett
> 
> Blog: [http://gilesbowkett.blogspot.com](http://gilesbowkett.blogspot.com)  
> Portfolio: [http://www.gilesgoatboy.org](http://www.gilesgoatboy.org)  
> Tumblelog: [http://giles.tumblr.com/](http://giles.tumblr.com/)

---

<div class="post-metadata">

**Author:** ![a11](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/a11/32/8169_2.png) [@a11](https://rubytalk.org/u/a11)\
**Post date:** [12 October 2007 17:07 UTC](https://rubytalk.org/t/wtf-gem-command-vanished/41335/10 "2007-10-12T17:07:12Z")

</div>

no i meant on option to gem that would delete itself. or maybe a feature that just does it randomly?

(kidding)

a @ [http://codeforpeople.com/](http://codeforpeople.com/)

> **···**
>
> On Oct 12, 2007, at 10:30 AM, Eric Hodel wrote:
> 
> > An uninstaller for RubyGems? Yes, but I have no interest in writing it now.
> 
> --  
> it is not enough to be compassionate. you must act.  
> h.h. the 14th dalai lama

---

<div class="post-metadata">

**Author:** ![James\_Britt](https://avatars.discourse-cdn.com/v4/letter/j/22d042/32.png) [@James\_Britt](https://rubytalk.org/u/James_Britt)\
**Post date:** [12 October 2007 17:15 UTC](https://rubytalk.org/t/wtf-gem-command-vanished/41335/11 "2007-10-12T17:15:30Z")

</div>

> and in my world they are all them same - you just have to guard them in order to make them re-entrant. safest thing on osx - the dotfile semantics there are weird...

Ara, they work the same in Bash on any system.

---

<div class="post-metadata">

**Author:** ![mortee](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@mortee](https://rubytalk.org/u/mortee)\
**Post date:** [12 October 2007 16:52 UTC](https://rubytalk.org/t/wtf-gem-command-vanished/41335/12 "2007-10-12T16:52:34Z")

</div>

Giles Bowkett wrote:

> It's true, I did mess around with my PATH the other day. I was going  
> nuts trying to install lejos, which is the Java API and VM for Lego  
> Mindstorms robots. But the weird thing is that I reverted the changes  
> in my .profile (to add to the list of dot files) and gem's still  
> invisible to bash.
> 
> I think something went wrong with gem itself. I'm expecting it to be  
> in /opt/local/bin/gem, but it isn't there. The output from locate gem  
> is absurd overkill, but maybe a long-running find.

I guess you should consider how you installed ruby, then find out what  
prefix it uses, and compare that to your current value of PATH.

mortee

---

<div class="post-metadata">

**Author:** ![a11](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/a11/32/8169_2.png) [@a11](https://rubytalk.org/u/a11)\
**Post date:** [12 October 2007 17:50 UTC](https://rubytalk.org/t/wtf-gem-command-vanished/41335/13 "2007-10-12T17:50:01Z")

</div>

technically that is true, but each system configures the system wide bash files diffrently

[http://www.railsforum.com/viewtopic.php?pid=39026](http://www.railsforum.com/viewtopic.php?pid=39026)

> **[Macworld](https://www.macworld.com)**
>
> Macworld is your ultimate guide to Apple's product universe, explaining what's new, what's best and how to make the most out of the products you love.

[http://thefactoryfactory.com/wordpress/?p=287](http://thefactoryfactory.com/wordpress/?p=287)

users coming from linux to bsd/osx are sometime surprised to find their .bashrc not sources in certain situations - this is due to the setup in /etc, not bash itself. regardless it's a source of confusion for many people.

regards.

a @ [http://codeforpeople.com/](http://codeforpeople.com/)

> **···**
>
> On Oct 12, 2007, at 11:15 AM, John Joyce wrote:
> 
> > Ara, they work the same in Bash on any system.
> 
> --  
> it is not enough to be compassionate. you must act.  
> h.h. the 14th dalai lama

---

<div class="post-metadata">

**Author:** ![Giles\_Bowkett](https://avatars.discourse-cdn.com/v4/letter/g/96bed5/32.png) [@Giles\_Bowkett](https://rubytalk.org/u/Giles_Bowkett)\
**Post date:** [12 October 2007 18:49 UTC](https://rubytalk.org/t/wtf-gem-command-vanished/41335/14 "2007-10-12T18:49:18Z")

</div>

> \> An uninstaller for RubyGems? Yes, but I have no interest in  
> \> writing it now.
> 
> no i meant on option to gem that would delete itself. or maybe a  
> feature that just does it randomly?
> 
> (kidding)

as far as I can tell an uninstaller for RubyGems has evolved  
spontaneously on my machine. if I catch it and tame it, I will be  
happy to transfer it to a holding pen somewhere.

> **···**
>
> --  
> Giles Bowkett
> 
> Blog: [http://gilesbowkett.blogspot.com](http://gilesbowkett.blogspot.com)  
> Portfolio: [http://www.gilesgoatboy.org](http://www.gilesgoatboy.org)  
> Tumblelog: [http://giles.tumblr.com/](http://giles.tumblr.com/)

---

<div class="post-metadata">

**Author:** ![James\_Britt](https://avatars.discourse-cdn.com/v4/letter/j/22d042/32.png) [@James\_Britt](https://rubytalk.org/u/James_Britt)\
**Post date:** [12 October 2007 18:32 UTC](https://rubytalk.org/t/wtf-gem-command-vanished/41335/15 "2007-10-12T18:32:04Z")

</div>

not sources? huh?  
I think it's linux that might be deviating on that actually, but it shouldn't matter.  
in all of them, there is a load precedence precedence on the file name and location. Some of the files officially have the same precedence, but might get slightly higher by being loaded in the order of the file name.  
It's a fairly simple system, but has weaknesses, particularly the ability to have multiple files that do the same thing and may have conflicting information in them.

> **···**
>
> On Oct 12, 2007, at 12:50 PM, ara.t.howard wrote:
> 
> > On Oct 12, 2007, at 11:15 AM, John Joyce wrote:
> > 
> > > Ara, they work the same in Bash on any system.
> > 
> > technically that is true, but each system configures the system wide bash files diffrently
> > 
> > [http://www.railsforum.com/viewtopic.php?pid=39026](http://www.railsforum.com/viewtopic.php?pid=39026)  
> > [Macworld - News, Tips & Reviews from the Apple Experts](http://forums.macosxhints.com/archive/index.php/t-34083.html)  
> > [Throwback to blogs](http://thefactoryfactory.com/wordpress/?p=287)
> > 
> > users coming from linux to bsd/osx are sometime surprised to find their .bashrc not sources in certain situations - this is due to the setup in /etc, not bash itself. regardless it's a source of confusion for many people.

---

<div class="post-metadata">

**Author:** ![a11](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/a11/32/8169_2.png) [@a11](https://rubytalk.org/u/a11)\
**Post date:** [13 October 2007 02:01 UTC](https://rubytalk.org/t/wtf-gem-command-vanished/41335/16 "2007-10-13T02:01:23Z")

</div>

> > users coming from linux to bsd/osx are sometime surprised to find their .bashrc not sources in certain situations - this is due to the setup in /etc, not bash itself. regardless it's a source of confusion for many people.
> 
> not sources? huh?

'sources'.sub /s$/, 'd'

> I think it's linux that might be deviating on that actually, but it shouldn't matter.  
> in all of them, there is a load precedence precedence on the file name and location. Some of the files officially have the same precedence, but might get slightly higher by being loaded in the order of the file name.

it's not quite just order - some are not loaded at all under certain situations. the .bashrc, for example is \*not\* sourced on login on some systems. linux does indeed do this differently so, if you're coming from that os you will have quite a suprised with a carefully crafted .bashrc.

cheers.

a @ [http://codeforpeople.com/](http://codeforpeople.com/)

> **···**
>
> On Oct 12, 2007, at 12:32 PM, John Joyce wrote:  
> --  
> share your knowledge. it's a way to achieve immortality.  
> h.h. the 14th dalai lama
