XCode: can't exec '/Developer/Library/Xcode/.../copystrings'

Published: 04 Oct 2008

While trying for the first time to build a very simple Cocoa project using XCode 3.1, I ran into the following error:

can't exec '/Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/copystrings' (No such file or directory)

At first glance, the error message suggests that the copystrings file is missing or has incorrect permissions. Although once I verified the file was present on my system, I tried executing it from the command line. Here's the result:

-bash: /Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/copystrings: /usr/bin/ruby: bad interpreter: No such file or directory

A ha! The real cause of the issue is obvious now. For some reason, the expected path to my ruby executable is different from the actual path. So the solution I came up with was to first find the actual path to the Ruby executable using the following command:

which ruby

Which for my system, returned /opt/local/bin/ruby.

Then I created a symbolic link from the expected Ruby executable path to the actual path:

sudo ln -s /opt/local/bin/ruby /usr/bin/ruby

While this isn't an ideal fix, it will work until a better fix is in place. Now, if I try "Build and Go" again from XCode, it builds and runs my simple Cocoa app successfully.