Tag: mlab

Heroku / Unicorn上的重复导轨错误 – “执行过期”,一个ActionView :: Template :: Error

我的问题类似于以下内容,但情况略有不同。 Rails:执行在time_zone_select上过期 我的设置是: Rails 3.2.13 Unicorn 4.6.2 Mongoid 3.0.22 轻便摩托车1.4.2 在Heroku Cedar上运行。 MongoDB在MongoLab上托管。 错误分批进行,并且通常由Heroku进程重启来解决。 第一个通常是下面的那个: An ActionView::Template::Error occurred in [controller]#[action]: execution expired vendor/bundle/ruby/1.9.1/gems/moped-1.4.2/lib/moped/sockets/connectable.rb:46:in `read’ 以下是堆栈跟踪的最高位。 如果需要,很乐意添加更多! vendor/bundle/ruby/1.9.1/gems/moped-1.4.2/lib/moped/sockets/connectable.rb:46:in `read’ vendor/bundle/ruby/1.9.1/gems/moped-1.4.2/lib/moped/sockets/connectable.rb:46:in `block in read’ vendor/bundle/ruby/1.9.1/gems/moped-1.4.2/lib/moped/sockets/connectable.rb:118:in `handle_socket_errors’ vendor/bundle/ruby/1.9.1/gems/moped-1.4.2/lib/moped/sockets/connectable.rb:46:in `read’ vendor/bundle/ruby/1.9.1/gems/moped-1.4.2/lib/moped/connection.rb:177:in `read_data’ vendor/bundle/ruby/1.9.1/gems/moped-1.4.2/lib/moped/connection.rb:99:in `block in read’ vendor/bundle/ruby/1.9.1/gems/moped-1.4.2/lib/moped/connection.rb:202:in `with_connection’ vendor/bundle/ruby/1.9.1/gems/moped-1.4.2/lib/moped/connection.rb:97:in `read’ vendor/bundle/ruby/1.9.1/gems/moped-1.4.2/lib/moped/protocol/query.rb:163:in `receive_replies’ vendor/bundle/ruby/1.9.1/gems/moped-1.4.2/lib/moped/connection.rb:135:in `block in receive_replies’ vendor/bundle/ruby/1.9.1/gems/moped-1.4.2/lib/moped/connection.rb:134:in `map’ vendor/bundle/ruby/1.9.1/gems/moped-1.4.2/lib/moped/connection.rb:134:in […]

Mongo :: OperationFailure – 使用from_uri时需要登录

我的目标是连接我的heroku / mongolab数据库,但我不断收到此错误: Mongo::OperationFailure at /mongotest/a/b : need to login file: networking.rb location: send_message_with_gle line: 89 我正在使用的代码是: client = Mongo::MongoClient.from_uri(ENV[‘MONGOLAB_URI’]) db = client.db(‘test’) testcoll = db[‘testcoll’] testcoll.insert({:’_id’ => “def”, :’test’ => “woop de doop”}) testcoll.find() ENV[‘MONGOLAB_URI’]=mongodb://heroku_app########:password@ds0xxxxx.mongolab.com:xxxxx/heroku_app######## 我知道uri是正确的,包含用户名和密码,为什么会出错呢? 此外,错误发生在insert()行,而不是我validation的行。