-bash: rails: command not found

M

Matt

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
 
B

Ben Bleything

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
 
M

matt neuburg

Ben Bleything said:
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.
 
B

Ben Bleything

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
 
M

Matt

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

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top