Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to run a program in /usr/local/bin/ called runserver.

/usr/local/bin is in $PATH...

echo $PATH /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

I am referencing the right program...

which runserver /usr/local/bin/runserver

Yet when I try to execute runserver I get error that bash is trying to execute runserver in /usr/bin

runserver bash: /usr/bin/runserver: No such file or directory

What am I missing?

share|improve this question
    
Can you post the contents of /usr/local/bin/runserver? –  i08in Apr 28 at 17:04
    
I stripped it down to something really simple... cd /www –  Jack Apr 28 at 17:06
    
Does the binary have the executable bit set (chmod +x file, I believe you otherwise get a permission denied error but I'm not sure)? Also, are you running a 64-bit OS and trying to execute a 32-bit binary? In this case you should install the 32-bit libraries (apt-get install ia32-libs). –  Louis Matthijssen Apr 28 at 17:06
    
What do you get when you specifically run /usr/local/bin/runserver? –  i08in Apr 28 at 17:07
3  
Can you just rehash your shell? hash -r for bash. –  choroba Apr 28 at 17:24

2 Answers 2

up vote 6 down vote accepted

Your shell probably remembers an old file that doesn't exist anymore. Try rehashing:

hash -r
share|improve this answer

Is the program executable? Try to do this first:

sudo chmod +x /usr/bin/runserver
share|improve this answer
    
There is no file in /usr/bin/runserver. The file is located in /usr/local/bin/runserver. –  i08in Apr 28 at 17:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.