xcode-select command not working

1.5k views Asked by At

I'm trying to install software via macports. For example when issuing the command

sudo port install KeePassX

I get the following error message:

Error:
Error: No valid Xcode installation is properly selected.
Error: Please use xcode-select to select an Xcode installation:
Error:     sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer # version 5.1.1
Error:
Warning: xcodebuild exists but failed to execute
Warning: Xcode does not appear to be installed; most ports will likely fail to build.
--->  Computing dependencies for KeePassX
--->  Dependencies to be installed: qt4-mac dbus jpeg libmng lcms tiff libpng
--->  Activating dbus @1.8.8_0
Error: org.macports.activate for port dbus returned: Image error: /Library/LaunchAgents/org.freedesktop.dbus-session.plist already exists and does not belong to a registered port.  Unable to activate port dbus. Use 'port -f activate dbus' to force the activation.
Error: Failed to install dbus
Please see the log file for port dbus for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_dbus/dbus/main.log
Error: The following dependencies were not installed: qt4-mac dbus jpeg libmng lcms tiff libpng
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: Processing of port KeePassX failed

When running

$ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/

I get the output

/usr/bin/xcode-select: line 2: exec: -s: invalid option
exec: usage: exec [-cl] [-a name] file [redirection ...]

The xcode-select command is in /usr/bin

$ which xcode-select
/usr/bin/xcode-select

and

$ ls -alh /usr/bin/xcode-select
lrwxr-xr-x  1 root  wheel     5B 16 Nov  2012 /usr/bin/xcode-select -> xcrun

and contains

$ cat /usr/bin/xcode-select
#!/bin/sh
exec "$@"

When I try to change the version in the command line settings in Xcode.app, there is an option XCODE 5.1.1, but when I choose it it goes back to grey. Any ideas of what could be the problem?

0

There are 0 answers