jjzjj

SSL_ERROR

全部标签

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 1.8.7 和 Net::HTTP:使用客户端证书发出 SSL GET 请求?

我正在尝试使用Net::HTTP通过SSL获取资源。这是相关的代码片段:req=Net::HTTP::Get.new(ContentURI.path)https=Net::HTTP.new(ContentURI.host,ContentURI.port)https.use_ssl=truehttps.cert=OpenSSL::X509::Certificate.new(@cert_raw)https.key=OpenSSL::PKey::RSA.new(@cert_key_raw)https.verify_mode=OpenSSL::SSL::VERIFY_PEERhttps.ca_

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 - 在缓存中找不到元素 - 页面可能在查找后发生了变化(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 - 是什么导致 OpenSSL::SSL::SSLErrorWaitReadable "read would block"?

OpenSSL::SSL::SSLErrorWaitReadable“readwouldblock”是什么意思?我收到错误OpenSSL::SSL::SSLErrorWaitReadable消息readwouldblock。我认为这是因为超时,但我找不到关于该主题的任何文档。谁能帮我弄清楚是什么原因造成的?还有我可以做些什么来防止这个问题?不时产生此错误的代码:data={hello:"world"}path="https://example.com/api"uri=URI.parse(path)http=Net::HTTP.new(uri.host,uri.port)http.use

ruby - kernel_require.rb :55:in `require' : cannot load such file error

我目前使用的是Ruby1.9.3版(尽管我在使用Ruby2.0.0时遇到了同样的问题)。在Windows764位上。我正在关注“TheCucumberBook”并卡在第7.2章-“使用转换删除重复项”。我的文件夹结构如下:\cash_withdrawal\cash_withdrawal\Gemfile\cash_withdrawal\Gemfile.lock\cash_withdrawal\features\cash_withdrawal\features\cash-withdrawal.feature\cash_withdrawal\features\step_definitions

ruby-on-rails - 尝试将本地数据库推送到 Heroku 后出现 "ActionView::Template::Error (Unknown primary key for table"

对于我通过Heroku托管的Ruby-on-Rails应用程序,我最近下载了一个备份,在本地恢复它,然后从外部来源将数据添加到数据库中。一切正常。在使用herokupg:pushHEROKU_DATABASE_URL--app将更新后的数据库推送到Heroku之后该应用程序运行良好,我可以看到新添加的数据。但是今天当我尝试在Heroku上登录该应用程序时,我收到了错误消息。在我的日志文件中,我看到了这个错误:ActionView::Template::Error(Unknownprimarykeyfortable...根据这篇SO帖子:Getting"Unknownprimarykey