在OsX mojave中安装CommandT。我得到错误Vim命令-T插件错误:无法加载C扩展
嗨,我已经尝试了每一件事,但仍然不起作用 错误说在OsX mojave中安装CommandT。我得到错误Vim命令-T插件错误:无法加载C扩展,vim,plugins,Vim,Plugins,嗨,我已经尝试了每一件事,但仍然不起作用 错误说 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
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>'
我花了5个多小时来研究这个问题,但仍然无法解决=]
我正在使用mac Mojave上一个版本在我今天升级了
brew之后,我也遇到了这个问题。我通过以下步骤修复了它:
更新命令-t fist
更新ruby
将ruby添加到路径中
检查ruby版本是否更新为2.6
再次构建commant-t
希望这些步骤可以解决您的问题。在我的路径开始处添加/usr/local/opt/ruby/bin
似乎可以解决这个问题。你知道为什么它不能只使用一个股票rbenv ruby路径吗?所有其他配置都正确。
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 */
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