警告在轨道中被视为错误 [英] warnings being treated as errors in rails

查看:169
本文介绍了警告在轨道中被视为错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  C:/ Ruby22 / bin / ruby​​.exe -r ./siteconf20150427-5772-lng4pk.rb extconf.rb 
创建Makefile

makeDESTDIR =clean

makeDESTDIR =
生成byebug-i386-mingw32.def
编译breakpoint.c
cc1.exe:警告被视为错误
在c:/ Ruby22 / include / ruby-2.2.0 / ruby​​ / defines.h:163:0,
来自c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:29,
来自c:/来自./byebug.h:4的
,来自breakpoint.c的
:1:
c:/ Ruby22 / include / ruby​​-2.2.0 / ruby-2.2.0 / ruby​​ / win32.h:319:44:错误:在参数列表中声明'struct timespec'
c:/Ruby22/include/ruby-2.2.0/ruby/win32.h:319: 44:错误:它的范围只是这个定义或声明,这可能不是你想要的
c:/Ruby22/include/ruby-2.2.0/ruby/win32.h:320 :43:错误:在参数列表中声明'struct timespec'
make:*** [breakpoint.o]错误1

失败,退出代码2

我在Windows 7上,经过很多研究,我发现我必须取消选择以警告为错误。任何人都知道在哪里可以取消设置这样的选项(在makefile中是不可能的,因为makefile是一个生成的文件)

解决方案

可能不是你想听到的。但是当我在开发Windows应用程序时,我遇到了这个错误。我还有很多与Rails无关的其他问题,以及更多与Ruby如何与Windows操作系统交互的问题。 Ruby本质上是非常懒惰的。因此,我建议在使用Ruby和Rails进行开发时使用运行linux ubuntu的虚拟机。

有一个叫做Vagrant的伟大的linux虚拟机。使用Ruby是非常棒的。他们有关于如何使用Ruby在这里找到并运行的文档:

https://www.vagrantup.com/



我希望这会有所帮助。我知道切换到Vagrant虚拟机帮助我解决了许多与编写实际代码毫无关系的无用问题。

I have the following error when i try to make "bundle install" in my rails projects

   C:/Ruby22/bin/ruby.exe -r ./siteconf20150427-5772-lng4pk.rb extconf.rb
creating Makefile

make "DESTDIR=" clean

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

make failed, exit code 2

i'm on windows 7, after research a lot, i find that i have to unset the option of take warnings as errors. Anyone knows where i can unset such option (in the makefile isn't possible because the makefile is a generated file)

解决方案

This may not be what you want to hear. But I had this error a lot when I was developing RoR applications out of windows. I also had a plethora of other issues that have nothing to do with rails, and more to do with how Ruby interacts with the Windows OS. Ruby is very "Linuxy" in it's nature. Because of this, I would recommend using a virtual machine running linux ubuntu when developing using Ruby and Rails.

There is a great linux virtual machine called "Vagrant". It has been wonderful to use Ruby in. They have documentation on how to get up and running with Ruby found here:

https://www.vagrantup.com/

I hope this helps. I know switching to the Vagrant virtual machine helped me solve a lot of these futile problems that had nothing to do with writing the actual code.

这篇关于警告在轨道中被视为错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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