Подтвердить что ты не робот

`Ошибка создания целевого контекста Swift AST: (null)` в REPL

Я видел несколько (ну, не так много, но несколько) вопросов здесь, на SO, касающихся этой ошибки, но ни один из предлагаемых решений не работал у меня. Это то, что я получаю

$ swift
Welcome to Apple Swift version 2.1.1 (swiftlang-700.1.101.15 clang-700.1.81). Type :help for assistance.
warning: Swift error in module repl_swift: 
    Error creating module Swift AST context: couldn't get a ClangImporter
Debug info from this module will be unavailable in the debugger.

warning: Swift error in module dyld: 
    Error creating module Swift AST context: couldn't get a ClangImporter
Debug info from this module will be unavailable in the debugger.

warning: Swift error in module CoreFoundation: 
    Error creating module Swift AST context: couldn't get a ClangImporter
Debug info from this module will be unavailable in the debugger.

...

warning: Swift error in module ServiceManagement: 
    Error creating module Swift AST context: couldn't get a ClangImporter
Debug info from this module will be unavailable in the debugger.

warning: Swift error in module libxslt.1.dylib: 
    Error creating module Swift AST context: couldn't get a ClangImporter
Debug info from this module will be unavailable in the debugger.

error: Error creating target Swift AST context: (null)

Это может произойти или не произойти после того, как я выпустил некоторую команду, которую я не помню (и моя история bash не очень помогает). Странно, что если я удалю Xcode, REPL начнет работать правильно. Однако, если я переустанавливаю Xcode, ошибки возвращаются. Кстати, я нахожусь на Xcode 7.2.1 (7C1002). Мысли?

4b9b3361

Ответ 1

Чтобы увидеть текущий путь Xcode:

xcode-select -p

Мой был старым путем:

/Applications/Xcode.app/Contents/Developer

Затем обновите этот путь с помощью:

sudo xcode-select -s /Library/Developer/CommandLineTools