Ruby on Rails在Windows

时间:2015-04-25 00:44:44

标签: ruby-on-rails byebug

我是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有警告?我需要配置编译器不将警告视为错误吗?

1 个答案:

答案 0 :(得分:0)

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