草庐IT

ACTION_APP_ERROR

全部标签

ruby-on-rails - SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 读取服务器 hello A - Faraday::Error::ConnectionFailed

我在这里看到了很多答案,但没有一个有效。我正在使用omniauth-oauth2gem与第三方客户集成。我正在使用描述的设置阶段here但我总是收到这个错误:Authenticationfailure!failed_to_connect:Faraday::Error::ConnectionFailed,SSL_connectSYSCALLreturned=5errno=0state=SSLv2/v3readserverhelloAFaraday::Error::ConnectionFailed(SSL_connectSYSCALLreturned=5errno=0state=SSLv2

ruby-on-rails - Ruby BigDecimal 圆 : Is this an error?

在用一个表示为BigDecimal的值编写测试时,我遇到了一些奇怪的事情并决定深入研究它。简而言之,四舍五入到小数点后两位的“0.00009”返回为0.01而不是0.00。真的。这是我的脚本/控制台捕获:>>bp=BigDecimal('0.09')=>#>>bp.round(2,BigDecimal::ROUND_HALF_DOWN).to_f=>0.09>>bp=BigDecimal('0.009')=>#>>bp.round(2,BigDecimal::ROUND_HALF_DOWN).to_f=>0.01>>bp=BigDecimal('0.0009')=>#>>bp.roun

ruby-on-rails - 什么是 :domain symbol referring to when configuring action mailer?

Appname::Application.configuredoconfig.action_mailer.delivery_method=:smtp#typicalsmtp_settingsforgmailaccountconfig.action_mailer.smtp_settings={:address=>"smtp.gmail.com",:port=>587,:domain=>"domain.of.sender.net",:authentication=>"plain":user_name=>"spencecooley":password=>"secret":enable_sta

ruby-on-rails - 处理身份登录的 OmniAuth::Error (invalid_credentials)

我使用OmniAuthIdentity进行正常登录。Rails3.2.3和Ruby1.9.3p194。目前,当现有用户尝试使用无效凭据登录时,我会收到以下错误:StartedPOST"/auth/identity/callback"for127.0.0.1at2012-07-1217:00:03-0400(identity)Callbackphaseinitiated.IdentityLoad(0.1ms)SELECT"identities".*FROM"identities"WHERE"identities"."email"='test'LIMIT1(identity)Authent

ruby-on-rails - 在rails app目录中将文件夹作为模块常量加载的方法

所以有一个Rails5项目并且想要加载这样的目录/app/services/userfoo.rb作为常量::Services::User::Foo有没有人有使用Rails自动加载路径以这种方式加载常量的经验?foo.rbmoduleServicesmoduleUserclassFooendendend解决方案将此添加到您的application.rb文件config.autoload_paths在此处查看有关自动加载的讨论https://github.com/rails/rails/issues/14382#issuecomment-37763348https://github.com

ruby - 在缓存中找不到元素 - 页面可能在查找后发生了变化(Selenium::WebDriver::Error::StaleElementReferenceError)

我正在尝试单击stackoveflow水平菜单上的所有链接(问题、标签、用户、徽章、未回答)。我有这段代码,但它点击了第一个链接(这个链接是问题),然后打印1,然后出现错误。这可能有什么问题?require'watir-webdriver'classStackoverflowdefclick_all_nav_linksb=Watir::Browser.newb.goto"http://stackoverflow.com"counter=0b.div(:id=>'hmenus').div(:class=>'navmainnavs').ul.lis.eachdo|li|li.a.click

ruby-on-rails - Rails ActiveRecord::StatementInvalid: PG::Error: ERROR: 缺少表的 FROM 子句条目

我有一个复杂的ActiveRecord查询,我正在根据用户的选择构建具有不同范围的查询。我正在使用2个gem,这似乎是有问题的,但我找不到谁是两者之间的罪魁祸首:Texticle(用于Postgresql完整搜索)(2.0.3)Squeel(用于ActiveRecord查询中的ruby​​语法)squeel(0.9.5)Arel或ActiveRecord本身这是我的类定义:classEvent"Entity",:foreign_key=>:entity_idbelongs_to:place,:class_name=>"Entity",:foreign_key=>:place_idcla

ruby-on-rails - PGError : ERROR: relation "table_name" does not exist

我正在尝试将一个简单的应用程序推送到heroku并运行:herokurakedb:migrate但是我得到以下错误:rakeaborted!PGError:ERROR:relation"posts"doesnotexist:SELECTa.attname,format_type(a.atttypid,a.atttypmod),d.adsrc,a.attnotnullFROMpg_attributeaLEFTJOINpg_attrdefdONa.attrelid=d.adrelidANDa.attnum=d.adnumWHEREa.attrelid='"posts"'::regclass

ruby-on-rails - rvm 安装 : ruby installation error

我想在我的LinuxMint12上安装ruby​​。我正在关注thistutorial和thisone.当我运行rvminstall1.9.3时,我看到了这个错误:InstallingRubyfromsourceto:/usr/share/ruby-rvm/rubies/ruby-1.9.3,thismaytakeawhiledependingonyourcpu(s)...ruby-1.9.3-#fetchingruby-1.9.3-#extractingruby-1.9.3-to/usr/share/ruby-rvm/src/ruby-1.9.3ERROR:Errorrunning'

ruby - 获取 `initialize' : wrong number of arguments(1 for 0) (ArgumentError) for simple ruby app

这是我的第一个ruby应用程序。我是一个堆栈溢出处女......当我运行以下程序时:classNameAppdefintialize(name)@names=[]enddefname_questionprint"Whatisyourname?"answer=gets.chomp@names+=answer.to_sputs"Thenumberofcharactersinyournameis"+names.lengthenddefname_lengthif@names.length>25thenprint"Yournameislongerthan25characters."elsepri