13

I have git configured to use ~/bin/opendiff-git.sh as my external diff tool. That script looks like this:

opendiff $2 $5

When I try and do a git diff from the command line, I get this message:

2011-02-18 13:58:55.532 opendiff[27959:60f] exception raised trying to run FileMerge: launch path not accessible
2011-02-18 13:58:55.535 opendiff[27959:60f] Couldn't launch FileMerge
external diff died, stopping at source/some_file.m.

What's going on? This has worked for many months, but stopped working recently.

Nick Forge
  • 20,944
  • 7
  • 50
  • 77

3 Answers3

31

So AFTER I deleted the beta developer folder to try and solve this (couldn't get the fix to work with merge tool) I stumbled upon this in the command line:

Error: No developer directory found at /Developer Beta. Run /usr/bin/xcode-select to update the developer directory path.

Turns out you can set the developer path you need it to use:

Usage: xcode-select -print-path
   or: xcode-select -switch <xcode_folder_path>
   or: xcode-select -version
Arguments:
   -print-path                     Prints the path of the current Xcode folder
   -switch <xcode_folder_path>     Sets the path for the current Xcode folder
   -version  

Looks like installing the beta had automatically set that path to beta. To fix it, run this:

sudo /usr/bin/xcode-select -switch /Developer

That fixed it for me.

Update

Ying's comment below was important enough to include in the answer. From Xcode 4.3 on, the location of the folder has changed to inside the application package:

sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer/
Community
  • 1
  • 1
Bob Spryn
  • 17,394
  • 12
  • 65
  • 89
  • 20
    sweet, that worked for me. With 4.3 on Lion, the Developer folder is now in the Xcode bundle itself, hence: sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer/ – Ying Feb 27 '12 at 14:02
2

If you have two SDKs installed, and the latest (presumably beta) version doesn't have the System Tools installed, some tools like opendiff can break. You can only have one set of System Tools installed at a time, so you have to choose which SDK/installation has it. I fixed this problem by using the path of opendiff that is in the Developer folder that had the system tools installed.

In my case, I have the following Xcode installations:

Current stable release (with System Tools installed)

/Developer

Latest beta (without System Tools installed)

/Developer (iOS SDK XXX beta)

My ~/bin/opendiff-git.sh script now looks like this:

"/Developer/usr/bin/opendiff" $2 $5
Nick Forge
  • 20,944
  • 7
  • 50
  • 77
  • Even after adding that file I still get the error... :( I'm no sure to understand why... Are you sure about the ~/bin/... part ? – Psycho Mar 18 '11 at 15:04
  • I used this answer here to set it up originally: http://stackoverflow.com/questions/736911/how-do-you-make-git-diff-use-gitx-diff-on-os-x/1251394#1251394. Only difference is, I put my `opendiff-git.sh` in `~/bin` instead of `~`, which means you also have to set the git `diff.external` global config option to `~/bin/opendiff-git.sh`. You can get rid of the `bin` if your `opendiff-git.sh` script is in your home directory. – Nick Forge Mar 19 '11 at 04:59
1

first the reason is xcode's installation path modified since 4.3, so must reselect xcode path

full guide is in below link: http://useyourloaf.com/blog/2012/2/17/updating-to-xcode-43.html

Foster Yin
  • 82
  • 3