1

OK, this question may sound too basic, but this doesn't mean I'm not still a bit confused :

  • I'm running OS X 10.6.8 (shouldn't make much difference though, the issue is more like *nix-specific)
  • I had installed (with a setup package) an app (D for Xcode) which obviously spread its binaries throughout the system
  • Then, I tried deleting the main binary from where it was supposed to be (/Library/Compilers/dmd2/osx/bin/dmd) and installed it (actually I'm talking about the D compiler, but shouldn't really matter) as usual on /usr/bin

Now, here's the issue :

  • If I try to execute the app like /usr/bin/dmd, it works fine
  • If I try to run it just with dmd (it's in /usr/bin, which is in turn belongs to the $PATH, right?), it tries to launch it from the previous location and I'm getting errors...

    dmd: failed to launch executable at /Library/Compilers/dmd2/osx/bin/dmd.drkiMac
    

Any ideas how this could be fixed, so that when typing dmd it looks at the correct location?

4
  • You probably shouldn't have deleted the binary but properly uninstalled the app—but what is your path now? echo $PATH will list it. There might be a leftover setting in your shell profile or /etc/paths.d
    – slhck
    Feb 7, 2013 at 7:46
  • @slhck First, there was no 'proper' un-installation method, and even so it couldn't open the binary (which was there) in the first place. Well, my $PATH is /opt/local/bin:/opt/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin/engines:/usr/X11/bin:/opt/local/bin:/opt/local/sbin which doesn't look that helpful. Now, as for /etc/paths.d, I don't think there is anything helpful in there as well (don't actually think this location is of much use to OS X, anyway) Feb 7, 2013 at 7:50
  • 1
    If it's not there it shouldn't reference the old directory. Have you tried restarting your shell in between? (In fact, /etc/paths.d is used for many system wide installers for its simplicity. Things like /etc/profile aren't even touched.)
    – slhck
    Feb 7, 2013 at 8:03
  • @slhck Geez! Just restarted the Terminal, and it works fine; feel kinda stupid... lol. Thanks a lot buddy! :-) Feb 7, 2013 at 8:05

1 Answer 1

1

Whenever you make changes to your $PATH you need to reload your shell's configuration. The easiest way to do that would be to simply restart your terminal application.

Otherwise your shell will still look for the binaries in their old place.

1
  • Quite a great catch. Will keep than in mind! Thanks, mate! ;-) Feb 7, 2013 at 8:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .