2015-04-25 103 views
0

我是Ruby on Rails的新手,試圖創建應用程序。 我運行rails myApp,安裝byebug時遇到了問題。Ruby on Rails在Windows上創建新應用程序失敗

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有警告?我需要將編譯器配置爲不將警告視爲錯誤?

+0

你已經安裝了[DevKit](https://github.com/oneclick/rubyinstaller/wiki/Development-Kit)來編譯庫嗎? – MarsAtomic

+0

我剛安裝它。它給出了同樣的錯誤。 –

+0

我的建議是要卸載它,如果你有它安裝。 https://github.com/deivid-rodriguez/byebug/issues/119 – MarsAtomic

回答

0

您應該嘗試卸載/重新安裝DevKit for Windows,MarsAtomic提供了建議。
對於Mac什麼我正在運行
xcode-select --install
以及在Gemfile中byebug指定github: 'deivid-rodriguez/byebug'(不知道它的必要雖然)工作。

相關問題