-bash: rails: command not found

I know lots of people seem to have this problem…I’ve been through the
posts and have followed the advice, but I’m still having trouble.

Terminal isn’t recognizing the rails command.

When I do a locate on rails, then echo $PATH, I’m told,

/bin:/sbin:/usr/bin:/usr/sbin

However, when I go through these directories in Terminal, rails is not
there. Instead, it’s in usr/local/bin. My bash_login file reads

export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"

Why is echo $PATH telling me that rails is in a different directory
than it actually is? And how can I get terminal to recognize the
command?

thanks,
matt

Matt [email protected] wrote:

there. Instead, it’s in usr/local/bin. My bash_login file reads

export PATH=“/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH”

Why is echo $PATH telling me that rails is in a different directory
than it actually is? And how can I get terminal to recognize the
command?

locate has nothing to do with $PATH, and echo $PATH doesn’t tell you
anything about where rails is; it tells you the value of your shell’s
$PATH variable. To find out where your shell thinks rails is, say:

which rails

If rails is not in your $PATH, the reply will be something like:

no rails in /usr/local/bin /usr/local/sbin /usr/local/mysql/bin /bin
/sbin /usr/bin /usr/sbin

To find out where rails really is, say:

find /usr -name “rails”

I suspect you need to sort out your $PATH. The fact that $PATH knows
nothing of, say, mysql suggests to me that whatever file it is you’ve
edited, it’s the wrong file. OMM, the thing to edit is .bash_profile
(but of course YMMV)…

m.

On Fri, Oct 27, 2006, matt neuburg wrote:

To find out where rails really is, say:

find /usr -name “rails”

Of course, this is going to take forever. If locate tells you a
location, try that. If rails isn’t there, run sudo updatedb and try
again.

It’s pretty much only ever going to end up in a handful of places
(unless you’re on a really weird platform). /usr/bin, /usr/local/bin,
/opt/local/bin (mac with dports)…

If you have to use find, pass in -type f:

find /usr -type f -name rails

Which’ll only find files, and run quicker than without.

Ben

Ben B. [email protected] wrote:

On Fri, Oct 27, 2006, matt neuburg wrote:

To find out where rails really is, say:

find /usr -name “rails”

Of course, this is going to take forever.

find /usr -name “dummy”

takes four seconds on my machine. We’re looking for an exact match and
there just ain’t that much stuff in /usr. m.

On Sat, Oct 28, 2006, matt neuburg wrote:

find /usr -name “dummy”

takes four seconds on my machine. We’re looking for an exact match and
there just ain’t that much stuff in /usr. m.

Significantly longer on mine, but I’ve got a slow HD and my /usr/local
is packed full of stuff.

The point is, always better to use everything you can to focus your
search.

Ben

Figured it out. Everything was set up right, but my bash_login file
should have been named .bash_login. Newbie mistake.