CommandTプラグインのすべてのインストール手順を完了した後、プラグインをcommand-t.vim could not load the C extension
起動するとエラーが発生します。ComamndTのトラブルシューティングセクションでは、次のアドバイスを提供しています。
If a problem occurs the first thing you should do is inspect the output of:
ruby extconf.rb
make
During the installation, and:
vim --version
And compare the compilation and linker flags that were passed to the
extension and to Vim itself when they were built. If the Ruby-related
flags or architecture flags are different then it is likely that something
has changed in your Ruby environment and the extension may not work until
you eliminate the discrepancy.
そして、確かに私には食い違いがあるようです。
からの出力は、 make
cygwinのgccがruby1.8を使用していることを示唆しています。
gcc -I. -I/usr/lib/ruby/1.8/i386-cygwin -I/usr/lib/ruby/1.8/i386-cygwin -I. -DHA
VE_RUBY_H -g -O2 -std=c99 -Wall -Wextra -Wno-unused-parameter -c ext.c
gcc -I. -I/usr/lib/ruby/1.8/i386-cygwin -I/usr/lib/ruby/1.8/i386-cygwin -I. -DHA
VE_RUBY_H -g -O2 -std=c99 -Wall -Wextra -Wno-unused-parameter -c match.c
gcc -I. -I/usr/lib/ruby/1.8/i386-cygwin -I/usr/lib/ruby/1.8/i386-cygwin -I. -DHA
VE_RUBY_H -g -O2 -std=c99 -Wall -Wextra -Wno-unused-parameter -c matcher.c
gcc -shared -s -o ext.so ext.o match.o matcher.o -L. -L/usr/lib -L. -Wl,--enabl
e-auto-image-base,--enable-auto-import,--export-all -lruby -ldl -lcrypt
vimからの出力には、次の:version
出力が含まれています。
-DDYNAMIC_RUBY_VER=191 -DDYNAMIC_RUBY_DLL=\"msvcrt-ruby191.dll\"
トラブルシューティングガイドでは、Vim 7.2、Ruby 1.8.7-p299、およびDevKit3.4.5r3-20091110の組み合わせを使用することを推奨しています。ただし、これはいくつかの理由で私にとって良い解決策ではありません。
- 私はVim7.3を使用していますが、引き続き使用したいと思います。
- Ruby 1.9.3が私のシステムにインストールされており、他のプロジェクトのPATHに必要です。
では、最新バージョンのrubyと最新バージョンのvimを維持しながら、これを機能させる方法はありますか?
アップデート
AndrewMarshallのアドバイスに従って、このチュートリアルruby extconf.rb
に従ってRuby191とDevKit-4.5.0-20100819-1536-sfx.exeをインストールし、そのバージョンを実行しました。make
cmdは次の出力で正常に実行されました:
gcc -I. -IC:/Ruby191/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby191/include/ruby-1
.9.1/ruby/backward -I/C/Ruby191/include/ruby-1.9.1 -I. -DHAVE_RUBY_H -O2 -g -
Wall -Wno-parentheses -std=c99 -Wall -Wextra -Wno-unused-parameter -o ext.o -c
ext.c
gcc -I. -IC:/Ruby191/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby191/include/ruby-1
.9.1/ruby/backward -I/C/Ruby191/include/ruby-1.9.1 -I. -DHAVE_RUBY_H -O2 -g -
Wall -Wno-parentheses -std=c99 -Wall -Wextra -Wno-unused-parameter -o match.o
-c match.c
gcc -I. -IC:/Ruby191/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby191/include/ruby-1
.9.1/ruby/backward -I/C/Ruby191/include/ruby-1.9.1 -I. -DHAVE_RUBY_H -O2 -g -
Wall -Wno-parentheses -std=c99 -Wall -Wextra -Wno-unused-parameter -o matcher.
o -c matcher.c
gcc -shared -s -o ext.so ext.o match.o matcher.o -L. -LC:/Ruby191/lib -L. -Wl,-
-enable-auto-image-base,--enable-auto-import -lmsvcrt-ruby191 -lshell32 -lws2
_32
これでvimでの実行:CommandT
が機能しますが、入力を開始してファイルを検索し、Enterキーを押して選択して開くと、次のようになります。