Macports issues after Mountain Lion upgrade

Solution 1:

Here is how I fix it (after Mountain Lion update):

  • install the latest MacPorts DMG dedicated to Mountain Lion over the old one;
  • install the latest Xcode version from the AppStore (it doesn't update by itself!);
  • launch Xcode and agree to the licence;
  • in Xcode's Preferences, at the Download's tab, in the Components section, install Command Line Tools (as since Xcode 4.3);
  • don't forget that you must read and accept licence for it, this is possible after running the following command in the terminal: sudo xcodebuild -license.
    • Without this step, if you try to use sudo port install [something] or others, you'll have the following return: Error: org.macports.build for port libunwind-headers returned: command execution failed
  • in terminal:
    • sudo port selfupdate
    • sudo port upgrade outdated

After that, everything works except MongoDB, After some research, I found this article (How to upgrade MacPorts to OS X 10.8 Mountain Lion) by Phil Freo.

Thanks to this article, which reassured me in my approach, I also found the solution to my last issue:

Everything finished and worked properly except MongoDB. Currently there is an incompatibility between boost 1.50 and MongoDB which can be resolved with these two commands, assuming boost 1.49 was previously installed on your machine:

  • sudo port activate boost @1.49.0_0
  • sudo port -n install mongodb