草庐IT

error-Debug

全部标签

ruby-on-rails - Rails 3.0 & Ruby 1.9.2rc : Rake commands return 'already initialized constant' & stack level too deep errors. 任何想法

我正在尝试在Ubuntu10.04上运行Rails3beta4和Ruby1.9.2rc。它最初有效,但在完成我的第一个bundleinstall/package之后,我现在在所有Rails项目中都遇到以下错误。即使是基本的“railsnewtestproject”后跟一个rake也会显示错误消息。简而言之,我很难过。非常感谢任何有关可能导致此问题的帮助。我唯一注意到的事情——可能相关也可能不相关——是~/.bundle文件中的目录是ruby​​/1.9.1。我的机器上没有安装1.9.1-只有1.9.2rc。ruby-v带回1.9.2(in/home/john/Websites/sand

ruby-on-rails - 对象.有效?返回 false 但 object.errors.full_messages 为空

我对无法保存的对象感到困惑,简化模型是classSubscription"User",:foreign_key=>"user_id"has_many:transactions,:class_name=>"SubscriptionTransaction"validates_presence_of:first_name,:message=>"nepeutêtrevide"validates_presence_of:last_name,:message=>"nepeutêtrevide"validates_presence_of:card_number,:message=>"nepeutêt

ruby - 如何在需要必要的库和/或 header 时安装 ruby​​-debug

我的Rails是3.2.1.4,Ruby是1.9.3p448。我在安装ruby-debug时遇到错误:Buildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingruby-debug:ERROR:Failedtobuildgemnativeextension./home/hxh/.rvm/rubies/ruby-1.9.3-p448/bin/rubyextconf.rbCan'thandle1.9.xyet***extconf.rbfailed***CouldnotcreateMakefileduetosome

ruby - cucumber / capybara 错误:参数 [0] 未定义(Selenium::WebDriver::Error::JavascriptError)

我已经通过终端运行我的测试一段时间了,没有任何问题。:cucumber创建\新建\Game.feature其中包含以下内容:Feature:CreateNewGameBackground:GivenIamloggedinScenario:Cleanup&NewGame01ThenIDeletealltestGames还有ruby:Given(/^Iamloggedin$/)doel=first("button[ttag='account_dropdown_btn']",:visible=>true)ifel.nil?logMeIn("user@user1.com","pa55w0rd"

ruby-on-rails - 为什么 Rspec 说 "Failure/Error: Unable to find matching line from backtrace"?

我在这里学习Rails教程:http://railstutorial.org/chapters/filling-in-the-layout#top当我运行“rspecspec/”时,我得到一堆如下所示的错误:1)LayoutLinksshouldhaveaHomepageat'/'Failure/Error:Unabletofindmatchinglinefrombacktracestackleveltoodeep#C:/Ruby19/lib/ruby/1.9.1/forwardable.rb:1852)LayoutLinksshouldhaveaContactpageat'/cont

ruby-on-rails - Rails 应用程序:Solr 抛出 RSolr::Error::Http - 执行搜索时未找到 404

非常迷茫,因为我没有对我的搜索进行任何更改,该搜索一直有效,但不知何故我休息了。作为Rails的新手,错误输出没有给我足够的细节来进行调试。下面的相关代码-询问您是否还想查看其他内容。home.html.slim(带有搜索表单的摘录)=form_tagsearch_venues_path,method::get,id:'search'do|f|.search-fields.span16p=text_field_tag:q,'',placeholder:"Searchforcoffee,hotel,etc",class:'span7search-field'p=text_field_ta

ruby - 如何打印有关 NET :HTTPRequest for debug purposes? 的信息

我是从Java转过来接触Ruby的新手。我正在尝试发出一个httpget请求,我得到一个400的http响应代码。我通过http调用的服务非常特殊,我很确定我的请求不完全正确。“深入了解”req会很有帮助在我执行head请求(如下)以仔细检查正在发送的request_headers是否是我认为我正在发送的内容之后。有没有办法打印出req对象?req=Net::HTTP.new(url.host,url.port)req.use_ssl=trueres=req.head(pathWithScope,request_headers)code=res.code.to_iputs"Respon

ruby-on-rails - 错误 NoMethodError:ActionView::Base:Class 的未定义方法 `debug_rjs='

这个项目是用rails3.0.9构建的。现在我更新了gems和Gemfile=>source'http://rubygems.org'gem'rails','3.1.1'#BundleedgeRailsinstead:#gem'rails',:git=>'git://github.com/rails/rails.git'gem'pg'gem'devise'gem"will_paginate"gem'ruby-debug19'gem'rack','1.3.3'gem'jquery-rails'在railss之后,当我这样做时,http://0.0.0.0:3000/我得到这个错误=>=>

ruby - 安装 RVM : getting error "There was an error(23)."

我尝试安装RubyVersionManager(RVM)但没有成功。如何解决我遇到的这个错误?ubuntu@ip-172-31-0-20:/tmp$rvminstallruby-1.9.3-p484Searchingforbinaryrubies,thismighttakesometime.Nobinaryrubiesavailablefor:ubuntu/14.04/x86_64/ruby-1.9.3-p484.Continuingwithcompilation.Pleaseread'rvmhelpmount'togetmoreinformationonbinaryrubies.Ch

ruby-on-rails - ruby rails : how to get error messages from a child resource displayed?

当我呈现XML模板时,我很难理解如何让Rails为验证失败的子资源显示明确的错误消息。假设我有以下类(class):classSchool/^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i,:message=>"Youmustsupplyavalidemail"end现在,在Controller中,假设我们想要构建一个简单的API来允许我们添加一个新的学校,其中有一个学生(我再说一次,这是一个糟糕的例子,但发挥它的作用是为了问题)classSchoolsController@school.errors,:status=>:unprocessable_