我试图安装需要安装ruby DevKit的gems例如:

gem install sqlite3

这是输出:
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing sqlite3:
ERROR: Failed to build gem native extension.

/usr/local/bin/ruby.exe extconf.rb
checking for sqlite3.h... yes
checking for sqlite3_libversion_number() in -lsqlite3... yes
checking for rb_proc_arity()... yes
checking for sqlite3_initialize()... yes
checking for sqlite3_next_stmt()... yes
checking for sqlite3_backup_init()... yes
checking for sqlite3_column_database_name()... no
checking for sqlite3_enable_load_extension()... yes
checking for sqlite3_load_extension()... yes
creating Makefile

make
gcc -I. -I/usr/local/include/ruby-1.9.1/i386-cygwin -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -DHAVE
_RB_PROC_ARITY -DHAVE_SQLITE3_INITIALIZE -DHAVE_SQLITE3_NEXT_STMT -DHAVE_SQLITE3_BACKUP_INIT -DHAVE_SQLITE3_ENABLE_LOAD_EXTENSION -DHAVE_SQL
ITE3_LOAD_EXTENSION -I/usr/local/include -I/opt/local/include -I/sw/local/include -I/usr/include    -O3 -g -Wall -Wno-unused-parameter -Wno-
parentheses -Wpointer-arith -Wwrite-strings -Wno-long-long  -o backup.o -c backup.c
make: gcc: Command not found
make: *** [backup.o] Error 127


Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.3 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.3/ext/sqlite3/gem_make.out

我确实安装了make和gcc,不明白它为什么抱怨找不到命令。
这不仅发生在我尝试安装sqlite3 gem时,而且发生在其他需要安装de devkit的gem时。

最佳答案

devkit是为yarv的mingw端口而不是cygwin端口设计的。cygwin端口不需要devkit,因为cygwin本身已经包含了所有必要的工具、库和头文件。

07-24 09:31