Got this brand new error lately when trying to upgrade macports? No problem!
Apple decided to spare 150M of space by not installing by default the Command Line Tools so you will have to do it manually.
Startup the Xcode.app and in the Preferences menu download and install it like in the pictures below. In the fist image you can see that Command Line Tools is not installed so you will have to press on the Install button and wait for the package to be downloaded and installed.
Here, the Command Line Tools is not installed:
In this following picture, installation is in progress:
Now Command Line Tools is installed:
And MacPorts can be upgraded:
florians-MacBook-Pro:~ root# port selfupdate ---> Updating MacPorts base sources using rsync MacPorts base version 2.1.2 installed, MacPorts base version 2.2.0 downloaded. ---> Updating the ports tree ---> MacPorts base is outdated, installing new version 2.2.0 Installing new MacPorts release in /opt/local as root:admin; permissions 0755; Tcl-Package in /Library/Tcl Error: /opt/local/bin/port: port selfupdate failed: Error installing new MacPorts base: command execution failed florians-MacBook-Pro:~ root# port selfupdate ---> Updating MacPorts base sources using rsync MacPorts base version 2.1.2 installed, MacPorts base version 2.2.0 downloaded. ---> Updating the ports tree ---> MacPorts base is outdated, installing new version 2.2.0 Installing new MacPorts release in /opt/local as root:admin; permissions 0755; Tcl-Package in /Library/Tcl The ports tree has been updated. To upgrade your installed ports, you should run port upgrade outdated
The error below, to compare it with yours:
florians-MacBook-Pro:~ root# port -v install pdftk Warning: The Command Line Tools for Xcode don't appear to be installed; most ports will likely fail to build. Warning: See http://guide.macports.org/chunked/installing.xcode.html for more information. Error: Unable to open port: can't read "build.cmd": Failed to locate 'make' in path: '/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin' or at its MacPorts configuration time location, did you move it? Error: Unable to execute port: upgrade libiconv failed florians-MacBook-Pro:~ root# port selfupdate ---> Updating MacPorts base sources using rsync MacPorts base version 2.1.2 installed, MacPorts base version 2.2.0 downloaded. ---> Updating the ports tree ---> MacPorts base is outdated, installing new version 2.2.0 Installing new MacPorts release in /opt/local as root:admin; permissions 0755; Tcl-Package in /Library/Tcl Error: /opt/local/bin/port: port selfupdate failed: Error installing new MacPorts base: command execution failed