MacOS – MacPorts can’t recognize Xcode version properly

macosmacportsxcode

I've tried to run the following command to install "automake" package on my Mac:

MacBook:~ administrator$ sudo port install automake
Password:
Error: The installed version of Xcode (5.1.1) is too old to use on the installed OS version. Version 6.1 or later is recommended on Mac OS X 10.10.
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: Processing of port automake failed

The problem is shown in the line:

Error: The installed version of Xcode (5.1.1) is too old to use on the
installed OS version. Version 6.1 or later is recommended on Mac OS X
10.10.

But there is Xcode 6.1 installed on my Mac. I'm using OS X 10.10 Yosemite (MacPorts for 10.10 already installed).