嗨,我已经尝试了所有方法,但仍然无法正常工作
错误说
command-t.vim could not load the C extension.
Please see INSTALLATION and TROUBLE-SHOOTING in the help.
Vim Ruby version: 2.6.1-p33
正如文档所说,我必须使用make,这是我尝试的
cd ~/.vim/bundle/command-t/ruby/command-t/ext/command-t
ruby extconf.rb && make
我遇到另一个错误
checking for float.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/$(RUBY_BASE_NAME)
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:571:in `block in try_compile'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:524:in `with_werror'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:571:in `try_compile'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:1144:in `block in find_header'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:942:in `block in checking_for'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:350:in `block (2 levels) in postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:320:in `open'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:350:in `block in postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:320:in `open'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:346:in `postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:941:in `checking_for'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:1143:in `find_header'
from extconf.rb:18:in `header'
from extconf.rb:25:in `<main>'
在收到此错误之后,我尝试了多种方法在stackoverflow中使用,但现在仍然无法正常工作,我的ruby版本ruby 2.3.7p456在我的vim ruby版本= 2.6中
然后我尝试通过sudo find / -name mkmf.log和我在CommandT中的mkmf.log查找错误信息
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */
我花了5个小时以上的时间进行研究,但仍然无法解决=]
我使用的是Mac Mojave最新版本
答案 0 :(得分:2)
今天我做了brew upgrade
之后,我也遇到了这个问题。我通过以下步骤对其进行了修复:
cd ~/.vim/bundle/command-t/
git pull
git submodule update --remote --merge
brew reinstall ruby
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
$ ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin18]
cd ~/.vim/bundle/command-t/
rake make
希望这些步骤可以解决您的问题。