安装linecache时在Windows机器上收到错误错误:无法在上创建gem本机扩展 [英] Receiving error on Windows machine when Installing linecache ERROR: Failed to build gem native extension on

查看:192
本文介绍了安装linecache时在Windows机器上收到错误错误:无法在上创建gem本机扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当试图执行现有Ruby on Rails项目的 bundle install 时,当捆绑器达到安装linecache(0.43)时收到错误本地扩展。我在项目Gem文件中看不到linecache,所以我不能在没有它的情况下尝试打包。我正在运行Windows 7和JetBrains RubyMine 2.0.2。我已经尝试从RubyMine和命令行捆绑(我知道这些是等价的)。

When attempting to perform a bundle install of an existing Ruby on Rails project I receive an error when the bundler reaches Installing linecache (0.43) with native extensions. I don't see linecache in the projects Gem file so I can't try bundling without it. I'm running Windows 7 and JetBrains RubyMine 2.0.2. I have tried bundling from inside RubyMine and from the command line (I realize these are equivalent).

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

I have the following Ruby and DevKit-3.4.5-20100819-1535-sfx directories in my path:


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

以下是bundle命令的输出:

Below is the output from the bundle command:


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

我错过了什么导致了这个bundle的失败?

What am I missing that is causing this bundle to fail?

推荐答案

看起来可能是因为ruby安装路径中的空间C:/ Code Metrics /第2 / cmusv / autotest-growl / ruby​​ /...\":::/ b
$ b

Looks like it may be because of the space in a ruby installation path "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配置为使用不同的红宝石安装?您的PATH系统var是否已列出此路径,并且其优先级高于您的Ruby187安装?

Is RubyMine configured to use a different ruby installation? Does your PATH system var have this path listed and at a higher precedence than your Ruby187 install?

这篇关于安装linecache时在Windows机器上收到错误错误:无法在上创建gem本机扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆