[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

-bash: rails: command not found

matthewburton

10/27/2006 2:37:00 AM

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

5 Answers

matt

10/27/2006 3:23:00 AM

0

Matt <matthewburton@gmail.com> wrote:

> 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?

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.

--
matt neuburg, phd = matt@tidbits.com, http://www.tidbits...
Tiger - http://www.takecontrolbooks.com/tiger-custom...
AppleScript - http://www.amazon.com/gp/product/...
Read TidBITS! It's free and smart. http://www.t...

Ben Bleything

10/27/2006 3:48:00 PM

0

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

matt

10/27/2006 5:31:00 PM

0

Ben Bleything <ben@bleything.net> 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.

--
matt neuburg, phd = matt@tidbits.com, http://www.tidbits...
Tiger - http://www.takecontrolbooks.com/tiger-custom...
AppleScript - http://www.amazon.com/gp/product/...
Read TidBITS! It's free and smart. http://www.t...

Ben Bleything

10/27/2006 6:00:00 PM

0

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

matthewburton

10/27/2006 11:17:00 PM

0

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


Matt wrote:
> 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