草庐IT

real_connect

全部标签

ruby-on-rails - postgresql 数据库错误 : Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

当我运行rakedb:migrate或运行railss命令时,我得到同样的错误:Error:couldnotconnecttoserver:NosuchfileordirectoryIstheserverrunninglocallyandacceptingconnectionsonUnixdomainsocket"/var/run/postgresql/.s.PGSQL.5432"?当我尝试railss时,浏览器出现错误。这是我的database.ymldefault:&defaultadapter:postgresqlencoding:unicodepool:5development

ruby - 连接:SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)

我在获取SSL来验证证书时遇到了麻烦。我完全不知道证书是如何工作的,所以这是一个主要的障碍。这是我在运行脚本时遇到的错误:c:/Ruby191/lib/ruby/1.9.1/net/http.rb:611:in`connect':SSL_connectreturned=1errno=0state=SSLv3readservercertificateB:certificateverifyfailed(OpenSSL::SSL::SSLError)相关代码如下:client=Savon::Client.neworder_svcrequest=client.create_empty_cart

ruby-on-rails - Heroku Rails 部署失败,错误为 "could not connect to server: Connection refused"

在本地一切正常,但是当我尝试推送到heroku时出现错误:Running:rakeassets:precompileConnectingtodatabasespecifiedbyDATABASE_URLrakeaborted!couldnotconnecttoserver:ConnectionrefusedIstheserverrunningonhost"127.0.0.1"andacceptingTCP/IPconnectionsonport5432?/tmp/build_1903c764-07ce-4d06-aa45-6e78dec68af8/vendor/bundle/ruby/

ruby - 如果运行了 tls_start,EventMachine 会在 close_connection 上发出 close_notify 吗?

我正在尝试编写一个基于EventMachine的简单FTPS服务器。控制socket工作正常。当使用数据套接字进行数据传输时,似乎一切正常(TLS握手成功完成并接收到数据),但随后我收到一条错误消息。这是我在Filezilla中得到的:Command:LISTResponse:150OpeningASCIImodedataconnectionforfilelistTrace:CFtpControlSocket::TransferParseResponse()Trace:code=1Trace:state=4Trace:CFtpControlSocket::SendNextCommand

ruby-on-rails - rails : switch connection on each request but keep a connection pool

在我们的Rails应用程序中,我们需要根据请求的子域使用不同的数据库(每个国家/地区使用不同的数据库)。现在我们正在做类似于thisquestion中推荐的事情.也就是说,在每个请求上调用ActiveRecord::Base.establish_connection。但是itseemsActiveRecord::Base.establish_connection删除当前连接池并在每次调用时建立一个新连接。我做了这个快速基准测试,看看每次调用establish_connection和已经建立连接之间是否有任何显着差异:require'benchmark/ips'$config=Rails

ruby-on-rails - headless gem : webkit_server: cannot connect to X server

我在使用Headlessgem、Xvfb和我们的ci服务器运行capybara-webkit时遇到了一些问题。我们使用此设置对我们的RubyonRails3.2应用程序进行自动集成测试和javascript测试。在测试期间它提示说webkit_server:cannotconnecttoXserver但是当我psaux|grepXvfbdeploy16020.00.1616961912pts/2S+Jul100:00/usr/bin/Xvfb:99-screen01280x1024x24-ac我看到Xvfb正在运行。如果我使用--trace运行测试,它也只显示上面的错误日志,我无法调试

ruby-on-rails - sunspot_rails gem - "Errno::ECONNREFUSED (Connection refused - connect (2)) "

我使用gemsunspot_railshttps://github.com/outoftime/sunspot我按照http://railscasts.com/episodes/278-search-with-sunspot上的说明做了一切,但出现错误Errno::ECONNREFUSED(Connectionrefused-connect(2)):app/controllers/books_controller.rb:7:in`index'来自books_controller.rb的代码defindex@search=Book.searchdofulltextparams[:sear

ruby-on-rails - Rails Resque 工作人员因 PGError : server closed the connection unexpectedly 失败

我在Ubuntu9.10、Rails2.3.4、ruby-ee2010.01、PostgreSQL8.4.2上有站点运行rails应用程序和在生产模式下运行的resqueworkerWorkers不断报错:PGError:serverclosedtheconnectionunexpectedly.我最好的猜测是masterresque进程建立了与db的连接(例如,authlogic在使用User.acts_as_authentic时会这样做),同时加载Rails应用程序类,并且该连接在fork()ed进程(退出时?)中被破坏,所以下一个fork的child会得到一种splinter的全

ruby - Heroku Rails 4 无法连接到服务器 : connection refused

使用postgres。一直推不开。没有任何运气尝试过:config.assets.initialize_on_precompile=false----->PreparingappforRailsassetpipelineRunning:rakeassets:precompilerakeaborted!couldnotconnecttoserver:ConnectionrefusedIstheserverrunningonhost"127.0.0.1"andacceptingTCP/IPconnectionsonport5432? 最佳答案

ruby - 寻找 "real"使用延续的例子

我试图掌握延续的概念,我从Wikipediaarticle中找到了几个像这样的小教学示例。:(definethe-continuation#f)(define(test)(let((i0));call/cccallsitsfirstfunctionargument,passing;acontinuationvariablerepresentingthispointin;theprogramastheargumenttothatfunction.;;Inthiscase,thefunctionargumentassignsthat;continuationtothevariablethe