草庐IT

when_GLIBCXX_DEBUG

全部标签

ruby-on-rails - 设计/Omniauth 失败 : How to debug it?

尝试“使用Google登录”后,我在日志中看到此错误:ProcessingbyUsers::OmniauthCallbacksController#failureasHTML我可以看到通过URL(在日志中)发送的来自谷歌的所有数据,包括用户电子邮件和姓名。那么会出什么问题呢?我的回调甚至没有被执行。我只会被重定向到我网站的登录页面。而且我很确定一切都配置正确,因为几周前它运行良好。我不认为我改变了什么。Facebook登录仍然正常。关于如何调试此故障的任何想法?除了那些充满参数和值的长URL之外,日志中没有其他内容。只有INFO消息。上面发布的是唯一一个说失败的。更新我向Control

ruby-on-rails - rails 4 : Error when installing tiny_tds gem?

我使用Rubyv2和Railsv4开发了一个RailsWeb项目。它在我当前的系统中运行良好,当我尝试在另一台Linux机器(Ubuntu12.4)中运行该项目时,出现Tidy_tds错误。此错误在bundleinstall时显示,错误详情如下Gem::Ext::BuildError:ERROR:Failedtobuildgemnativeextension./home/action/.rvm/rubies/ruby-2.1.1/bin/rubyextconf.rbcheckingforiconv_open()iniconv.h...yescheckingforsybfront.h..

ruby-on-rails - RSpec 故事和规范 : When to use what?

所以我想开始使用RSpec故事,但我不确定编写Controller、模型和View规范的位置。例如,您有“登录”故事和“用户提供错误的密码”场景,难道您最终测试的不是与Controller/模型规范相同的东西(response.shouldrender...,user.shouldbe_nil等)所以我的问题是:对于那些习惯于使用RoR进行bdd(或故事dd)的人,您是否仍然编写模型/Controller规范?如果是这样,您遵循的工作流程如何(“第一个故事,然后缩小到特定规范”)? 最佳答案 如果您现在开始使用故事(而不是拥有大量遗

ruby-on-rails - rails : RuntimeError - can't modify frozen Array when running rspec in rails

我最近从v4.3升级到Rails5.1,现在在运行测试时遇到这个错误:Anerroroccurredwhileloading./spec/controllers/admin/capacity_charges_controller_spec.rb.Failure/Error:requireFile.expand_path('../../config/environment',__FILE__)RuntimeError:can'tmodifyfrozenArray我为每个测试文件都得到了它。触发错误的行来自rails_helper。我已经检查了Rails5.1示例repo协议(protoc

ruby-on-rails - 如何在 ruby​​ 1.9.3/Rails 3.2.1 中安装 ruby​​-debug

这个问题在这里已经有了答案:关闭10年前。PossibleDuplicate:Rails3.1andRuby1.9.3p125:ruby-debug19stillcrasheswith“Symbolnotfound:_ruby_threadptr_data_type”我已经完成了打印到控制台的工作——我想回到20世纪并开始使用调试器!!但是如何安装ruby​​-debug?当我尝试安装ruby​​-debug19gem时,ruby-debug.c的native编译失败。我查看了其他SO帖子,但还没有找到答案......我正在使用Ruby1.9.3-p0我正在使用Rails3.2(当然还

ruby - 为什么在生产中使用 Net::HTTP 的 set_debug_output 是危险的?

Net::HTTP库中有一个非常有用的方法可以调试HTTP请求。这是文档对此的描述:set_debug_output(output)WARNINGThismethodcausesserioussecurityhole.Neverusethismethodinproductioncode.Setanoutputstreamfordebugging.http://ruby-doc.org/stdlib/libdoc/net/http/rdoc/classes/Net/HTTP.html#M001371这里提到的安全漏洞是什么? 最佳答案

ruby-on-rails - 工厂女郎 + RSpec : undefined method 'create' when create(:user)

不能调用“dummy=create(:user)”来创建用户。来回走了好几个小时。/home/parreirat/backend-clone/Passworks/spec/models/user_spec.rb:15:in`block(2levels)in':undefinedmethod`create'for#(NoMethodError)"这是工厂,users.rb:FactoryGirl.definedofactory:userdoemail'heheheheheheh@gmail.com'password'chucknorris'name'luismendes'endend这就

ruby - 我如何在 Emacs 中使用 ruby​​-debug?

我知道Emacs与gdb有某种集成(虽然我从未使用过它)以在调试程序时跳转文件。我想对Ruby程序做同样的事情。 最佳答案 正如erenon所说,使用ruby​​调试,它为emacs提供了一个库,让您可以像gdb一样使用它。通过在您的终端上发出此命令来安装rdebug(sudo是可选的,具体取决于您的系统):geminstallruby-debug然后你需要download来自ruby​​forge的ruby​​-debug-extra文件,并以标准方式安装它。sh./configuremakemaketest#optional,b

ruby-on-rails - 摩卡 : How to add expectation of a method when there are multiple invocations with different parameters

我有一个RailsControllerAction要测试。在那个Action中,一个方法User.can?使用不同的参数多次调用。在其中一个测试用例中,我想确保User.can?('withdraw')被调用。但我不关心User.can的调用?与其他参数。defaction_to_be_tested...@user.can?('withdraw')...@user.can?('deposit')...end我在测试中尝试了以下:User.any_instance.expects(:can?).with('withdraw').at_least_once.returns(true)但是测

ruby-on-rails - 错误 "' Validate_default_type !': An option' s default must match its type (ArgumentError)"when running Ruby on Rails generate on Windows

我正在关注thistutorial并且刚刚开始。我已经使用geminstallrails安装了RubyonRails,并使用railsnewblog创建了一个博客。教程现在说我需要运行railsgeneratecontrollerWelcomeindex,但是当我这样做时,我得到了这个错误:C:/Ruby22/lib/ruby/gems/2.2.0/gems/thor-0.19.2/lib/thor/parser/option.rb:130:in`validate_default_type!':Anoption'sdefaultmustmatchitstype.(ArgumentErr