Vim YouCompleteMe异常
异常信息如下:
The ycmd server SHUT DOWN (restart with ':YcmRestartServer').
Unexpected error while loading the YCM core library.
Use the ':YcmToggleLogs' command to check the logs.
出现这个问题可能是通过bundle更新了YCM,但是本地没有重新编译YCM,因此YCM会提示重新编译它。YCM在安装说明里也特别说明了。
1.重新编译YouCompleteMe
YouCompleteMe/install.py --clang-completer ## 进入bundle目录,并执行YouCompleteMe编译
注意在MacOSx等一些操作系统在重新编译的时候可能会提示如下信息:
CMake Error at ycm/CMakeLists.txt:124 (message):
Cannot find path to libclang in prebuilt binaries
这个时候可以加上参数:--system-libclang
,如:
YouCompleteMe/install.py --clang-completer --system-libclang
2.1.重装YouCompleteMe
如果重新编译仍然解决不了问题,那么可以考虑重装,以下是MacOS X重装YouCompleteMe
方案,仅供参考。
python3 YouCompleteMe/install.py --clang-completer --racer-completer
2.2.安装YouCompleteMe过程中提示cargo异常
ERROR: cargo is required for the Rust completer.
如果提示cargo异常,需要安装cargo,命令如下:
curl -sSf https://static.rust-lang.org/rustup.sh | sh
cargo安装成功后再重试上述步骤2.1