gpt4 book ai didi

ruby-on-rails - 警告被视为 rails 中的错误

转载 作者:太空宇宙 更新时间:2023-11-03 18:13:31 25 4
gpt4 key购买 nike

当我尝试在我的 Rails 项目中进行“捆绑安装”时出现以下错误

   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

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

最佳答案

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

有一个很棒的 Linux 虚拟机叫做“Vagrant”。使用 Ruby 真是太棒了。他们在此处提供了有关如何启动和运行 Ruby 的文档:

https://www.vagrantup.com/

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

关于ruby-on-rails - 警告被视为 rails 中的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29901627/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com