macports.conf points to a non-existing directory.

QUICK TIP:

If you receive the following error while attempting to install MacPorts, there is a quick and easy fix:

Warning: Your developer_dir setting in macports.conf points to a non-existing directory. Since this is known to cause problems, please correct the setting or comment it and let macports auto-discover the correct path.

The following commands will let you locate the current path, then set this into the macport.conf file, making installation of your MacPorts package more robust.

First, determine the actual path on your machine. Your path may vary. The path shown below is for my OSX 10.7 box.


xcode-select --print-path
/Applications/Xcode 4.3.3.app/Contents/Developer

Next, edit the macports.conf file, replacing the current entry with the one you just found above:


sudo vi /opt/local/etc/macports/macports.conf

[...]

# Directory containing Xcode Tools
#developer_dir /Developer
developer_dir /Applications/Xcode 4.3.3.app/Contents/Developer

[...]

Once you have done that, when you run the installation command, you’ll no longer see that annoying warning, and your MacPorts should be installed, ready for you to enjoy!


sudo port -c install coreutils +with_default_names