travis.rb
travis.rb copied to clipboard
Travis gets cached at wrong location?
This is a weird bug, but I can't imagine how I could have caused it, so it feels like something on your side.
After installing travis for the first time (Ubuntu 16.04):
sudo gem install travis -v 1.8.2 --no-rdoc --no-ri
And trying to run it, I got:
% travis
bash: /usr/bin/travis: No such file or directory
Which was weird. I looked this up pretty thoroughly and nobody else seemed to have this issue except for one fairly useless blog post. Eventually, I thought that checking the location of travis might be useful, so I ran:
% which travis
/usr/local/bin/travis
Interesting. The error I'm getting is trying to run travis from /usr/bin/travis
, but which
thinks it's at /usr/local/bin/travis
.
Turns out that bash keeps a cache of where programs are:
% type travis
travis is hashed (/usr/bin/travis)
Interesting! So I cleared it:
% hash -r
And sure enough, that fixed it:
% type travis
travis is /usr/local/bin/travis
% travis
Shell completion not installed. Would you like to install it now? |y|
My conclusion is that somehow the wrong location got cached into the bash shell during installation, because I had this problem immediately after doing the installation. Bizarre!
I had the same issue. In my case it was because I first installed travis
via apt
. This will install a "trajectory analyzer and visualizer".
Thanks for this posting this! I made the same mistake as hansthen and this solved my problem.
Thank you @mlissner I face this issue after you a year :)
Same thing happened for me, 0ct 2017.
Am I correct to understand that this is due to the travis
package being installed prior to installing the travis
gem?
@BanzaiMan correct, that will cause this issue.
@mlissner I had the same problem, I solved it as follows hash -r that's right, without the '%'