0

我是 Ruby on Rails 的新手,正在尝试制作一个应用程序。我跑了rails new myApp,在安装byebug的时候遇到了问题。

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

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

make "DESTDIR=" clean
      0 [main] rm 5012 open_stackdumpfile: Dumping stack trace to rm.exe.stackdump
make: [clean-static] Error 5 (ignored)
      0 [main] rm 4148 open_stackdumpfile: Dumping stack trace to rm.exe.stackdump
make: [clean] Error 5 (ignored)

make "DESTDIR="
generating byebug-i386-mingw32.def
compiling breakpoint.c
cc1.exe: warnings being treated as errors
In file included from c:/Ruby21/include/ruby-2.1.0/ruby/defines.h:217:0,
                 from c:/Ruby21/include/ruby-2.1.0/ruby/ruby.h:29,
                 from c:/Ruby21/include/ruby-2.1.0/ruby.h:33,
                 from ./byebug.h:4,
                 from breakpoint.c:1:
c:/Ruby21/include/ruby-2.1.0/ruby/win32.h:320:44: error: 'struct timespec' declared inside parameter list
c:/Ruby21/include/ruby-2.1.0/ruby/win32.h:320:44: error: its scope is only thisdefinition or declaration, which is probably not what you want
c:/Ruby21/include/ruby-2.1.0/ruby/win32.h:321:43: error: 'struct timespec' declared inside parameter list
make: *** [breakpoint.o] Error 1

make failed, exit code 2

Gem files will remain installed in C:/Ruby21/lib/ruby/gems/2.1.0/gems/byebug-4.0.5 for inspection.
Results logged to C:/Ruby21/lib/ruby/gems/2.1.0/extensions/x86-mingw32/2.1.0/byebug-4.0.5/gem_make.out
An error occurred while installing byebug (4.0.5), and Bundler cannot continue.
Make sure that `gem install byebug -v '4.0.5'` succeeds before bundling.

所以看起来编译器将警告视为错误,而 byebug 有警告?而且我需要将编译器配置为不将警告视为错误?

4

1 回答 1

1

您应该按照 MarsAtomic 的建议尝试卸载/重新安装适用于 Windows 的 DevKit。
对于 Mac 来说,对我有用的是在 Gemfile 中运行
xcode-select --install
并指定github: 'deivid-rodriguez/byebug'byebug(虽然不确定是否有必要)。

于 2015-04-30T21:40:22.807 回答