wtf? gem command vanished

J

John Joyce

Check your PATH
Install anything recently that likes to change the path ? (python
for example or other command line tools?)
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!
 
A

ara.t.howard

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

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/
 
G

Giles Bowkett

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
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com/
 
M

mortee

Giles said:
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
 
J

John Joyce

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.
 
A

ara.t.howard

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://forums.macosxhints.com/archive/index.php/t-34083.html
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/
 
J

John Joyce

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

http://www.railsforum.com/viewtopic.php?pid=39026
http://forums.macosxhints.com/archive/index.php/t-34083.html
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.
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.
 
G

Giles Bowkett

An uninstaller for RubyGems? Yes, but I have no interest in
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
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com/
 
A

ara.t.howard

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/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

is pastie dead? 3
another Ruby on Rails certificate program 6
rubyforge 101 3
site-specific.rb? 3
gem build documentation for new gems? 10
infinite streams in ruby 1.9? 5
Class#aliases? 8
add binary to gem spec? 5

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top