安装linecache时在Windows机器上接收错误错误:无法构建gem本机扩展

时间:2010-10-26 17:11:02

标签: ruby-on-rails ruby rubygems bundle-install linecache

当尝试执行现有Ruby on Rails项目的bundle install时,当捆绑器到达Installing linecache (0.43) with native extensions时会收到错误。我没有在项目Gem文件中看到linecache所以我不能尝试捆绑它没有它。我正在运行Windows 7和JetBrains RubyMine 2.0.2。我已经尝试从RubyMine和命令行中进行捆绑(我意识到这些是等价的)。

我的路径中有以下Ruby和DevKit-3.4.5-20100819-1535-sfx目录:

C:\Ruby187\bin
C:\DevKit-3.4.5-20100819-1535-sfx\bin
C:\DevKit-3.4.5-20100819-1535-sfx\mingw\bin

以下是bundle命令的输出:

Fetching source index for http://rubygems.org/
Using rake (0.8.7) 
Using activesupport (2.3.4) 
Using rack (1.0.1) 
Using actionpack (2.3.4) 
Using actionmailer (2.3.4) 
Using activerecord (2.3.4) 
Using activeresource (2.3.4) 
Using authlogic (2.1.6) 
Using builder (2.1.2) 
Using mime-types (1.16) 
Using xml-simple (1.0.12) 
Using aws-s3 (0.6.2) 
Using bundler (1.0.0) 
Using calendar_date_select (1.16.1) 
Using cgi_multipart_eof_fix (2.5.0) 
Using configuration (1.1.0) 
Using daemons (1.1.0) 
Using delayed_job (2.1.0.pre) 
Using factory_girl (1.3.2) 
Using gem_plugin (0.2.3) 
Using json_pure (1.4.6) 
Using launchy (0.3.7) 
Using rest-client (1.6.1) 
Using heroku (1.11.0)
Installing linecache (0.43) with native extensions C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/installer.rb:483:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

C:/Ruby187/bin/ruby.exe extconf.rb 
creating Makefile

make
Makefile:130: warning: overriding commands for target `C:/Code'
Makefile:124: warning: ignoring old commands for target `C:/Code'
gcc -I. -I/C/Ruby187/lib/ruby/1.8/i386-mingw32 -I/C/Ruby187/lib/ruby/1.8/i386-mingw32 -I.   -g -O2 -DFD_SETSIZE=256    -c trace_nums.c
gcc -shared -s -o trace_nums.so trace_nums.o -L. -LC:/Ruby187/lib -L.  -Wl,--enable-auto-image-base,--enable-auto-import,--export-all   -lmsvcrt-ruby18  -lshell32 -lws2_32  

make install
Makefile:130: warning: overriding commands for target `C:/Code'
Makefile:124: warning: ignoring old commands for target `C:/Code'
install -d C:/Code
/bin/install -c -m 0755 trace_nums.so C:/Code Metrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/linecache-0.43/lib
/bin/install: omitting directory `C:/Code'
make: *** [Metrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/linecache-0.43/lib/trace_nums.so] Error 1


Gem files will remain installed in C:/Code Metrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/linecache-0.43 for inspection.
Results logged to C:/Code Metrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/linecache-0.43/ext/gem_make.out
    from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/installer.rb:446:in `each'
    from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/installer.rb:446:in `build_extensions'
    from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/installer.rb:198:in `install'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/source.rb:100:in `install'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/installer.rb:55:in `run'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/spec_set.rb:12:in `each'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/spec_set.rb:12:in `each'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/installer.rb:44:in `run'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/installer.rb:8:in `install'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/cli.rb:217:in `install'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/task.rb:22:in `send'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/task.rb:22:in `run'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor.rb:246:in `dispatch'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/base.rb:389:in `start'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/bin/bundle:13
    from C:\Ruby187\bin/bundle:19:in `load'
    from C:\Ruby187\bin/bundle:19
    from -e:1:in `load'
    from -e:1

Process finished with exit code 1

我错过了什么导致此捆绑失败?

1 个答案:

答案 0 :(得分:2)

看起来可能是因为红宝石安装路径中的空间“C:/ Code Metrics / 2nd / cmusv / autotest-growl / ruby​​ /...”:

Makefile:130: warning: overriding commands for target `C:/Code'

/bin/install: omitting directory `C:/Code'
make: *** [Metrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/linecache-0.43/lib/trace_nums.so] Error 1

RubyMine是否配置为使用不同的ruby安装?您的PATH系统var是否列出了此路径,其优先级高于您的Ruby187安装?