简体   繁体   English

在 cygwin 中安装 gem wdm 时出错

[英]Errors Installing the gem wdm in cygwin

I keep getting this error while installing the gem wdm from inside cygwin.从 cygwin 内部安装 gem wdm 时,我不断收到此错误。 Does anybody had the same issue and know now to fix it.有没有人有同样的问题,现在知道修复它。 Thanks.谢谢。 (I am Trying to install Guard gem) (我正在尝试安装 Guard gem)

$ gem install wdm
Building native extensions.  This could take a while...
ERROR:  Error installing wdm:
ERROR: Failed to build gem native extension.

    /usr/bin/ruby.exe extconf.rb
checking for main() in -lkernel32... yes
checking for windows.h... yes
checking for ruby.h... yes
checking for HAVE_RUBY_ENCODING_H... yes
creating Makefile

make
gcc -I. -I/usr/include/ruby-1.9.1/i386-cygwin -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -DHAVE_WINDOWS_H -DHAVE_RUBY_H -DHAVE_CONST_HAVE_RUBY_ENCODING_H    -ggdb -O2 -pipe   -fno-strict-aliasing   -o entry.o -c entry.c
gcc -I. -I/usr/include/ruby-1.9.1/i386-cygwin -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -DHAVE_WINDOWS_H -DHAVE_RUBY_H -DHAVE_CONST_HAVE_RUBY_ENCODING_H    -ggdb -O2 -pipe   -fno-strict-aliasing   -o memory.o -c memory.c
gcc -I. -I/usr/include/ruby-1.9.1/i386-cygwin -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -DHAVE_WINDOWS_H -DHAVE_RUBY_H -DHAVE_CONST_HAVE_RUBY_ENCODING_H    -ggdb -O2 -pipe   -fno-strict-aliasing   -o monitor.o -c monitor.c
gcc -I. -I/usr/include/ruby-1.9.1/i386-cygwin -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -DHAVE_WINDOWS_H -DHAVE_RUBY_H -DHAVE_CONST_HAVE_RUBY_ENCODING_H    -ggdb -O2 -pipe   -fno-strict-aliasing   -o queue.o -c queue.c
gcc -I. -I/usr/include/ruby-1.9.1/i386-cygwin -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -DHAVE_WINDOWS_H -DHAVE_RUBY_H -DHAVE_CONST_HAVE_RUBY_ENCODING_H    -ggdb -O2 -pipe   -fno-strict-aliasing   -o rb_change.o -c rb_change.c
rb_change.c: In function ‘extract_absolute_path_from_notification’:
rb_change.c:47:16: error: ‘_MAX_FNAME’ undeclared (first use in this function)
rb_change.c:47:16: note: each undeclared identifier is reported only once for each function it appears in
rb_change.c:47:33: error: ‘_MAX_EXT’ undeclared (first use in this function)
Makefile:206: recipe for target `rb_change.o' failed
make: *** [rb_change.o] Error 1

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

A colleague of mine had an issue with wdm the other day.前几天,我的一位同事遇到了 wdm 的问题。

We fixed it by downloading the Ruby DevKit (Not sure if you already had this installed).我们通过下载 Ruby DevKit 修复了它(不确定您是否已经安装了它)。

I found some pretty decent step by steps online, I'll paste them here - hope they help我在网上找到了一些相当不错的步骤,我会把它们贴在这里 - 希望它们有所帮助

Development kit is here: http://rubyinstaller.org/downloads/开发工具包在这里: http : //rubyinstaller.org/downloads/

  1. Download the Development Kit and install it in say c:\\devkit.下载开发工具包并将其安装在 c:\\devkit 中。
  2. Open a command window and type c:.打开命令窗口并键入 c:。
  3. Change folders by typing cd devkit .通过键入cd devkit更改文件夹。
  4. Type ruby dk.rb init to generate the config.yml file to be used later.输入ruby dk.rb init生成 config.yml 文件以备后用。 Your installed Rubies will be listed there (only those installed by a RubyInstaller package are detected at present).您已安装的 Ruby 将在此处列出(目前仅检测到由 RubyInstaller 包安装的那些)。 This needs to be done only once.这只需执行一次。
  5. Finally type, ruby dk.rb install for DevKit enhance your installed Rubies.最后输入ruby dk.rb install for DevKit 增强您安装的ruby dk.rb install This needs to be done only once.这只需执行一次。

Confirm your Ruby environment is correctly using the DevKit by running:通过运行以下命令确认您的 Ruby 环境正确使用 DevKit:

gem install wdm --platform=ruby

It's crucial that you include the --platform=ruby option to force RubyGems to build the native gem rather than potentially installing an incorrect binary gem.包含--platform=ruby选项以强制 RubyGems 构建本机 gem 而不是可能安装不正确的二进制 gem 是至关重要的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM