使用:Rails 3.0.3 和 Heroku 与 Postgresql。
我收到了许多例外,例如:
A ActiveRecord::StatementInvalid occurred in home#index:
PGError: ERROR: current transaction is aborted, commands ignored until end of transaction block
: SELECT "calculation_types".* FROM "calculation_types"
.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract_adapter.rb:202:in `rescue in log'
发生在我的应用程序中,但总是在我执行这种情况时发生
calculation_type = CalculationType.find(params[:id])
或类似的,超级简单的数据库请求。
我的宝石列表(从我上传到 Heroku 时开始):
Installing rake (0.9.2.2)
Installing abstract (1.0.0)
Installing activesupport (3.0.3)
Installing builder (2.1.2)
Installing i18n (0.6.1)
Installing activemodel (3.0.3)
Installing erubis (2.6.6)
Installing rack (1.2.5)
Installing rack-mount (0.6.14)
Installing rack-test (0.5.7)
Installing tzinfo (0.3.33)
Installing actionpack (3.0.3)
Installing mime-types (1.19)
Installing polyglot (0.3.3)
Installing treetop (1.4.10)
Installing mail (2.2.19)
Installing actionmailer (3.0.3)
Installing arel (2.0.10)
Installing activerecord (3.0.3)
Installing activeresource (3.0.3)
Installing acts_as_tree_rails3 (0.1.0)
Installing breadcrumbs_on_rails (2.2.0)
Installing yamler (0.1.0)
Installing configatron (2.9.1)
Installing daemons (1.1.9)
Installing eventmachine (1.0.0) with native extensions
Installing exception_notification (2.4.1)
Installing friendly_id (4.0.0.beta12)
Installing i18n_routing (0.6.1)
Installing thor (0.14.6)
Installing railties (3.0.3)
Installing jquery-rails (1.0.19)
Installing pg (0.14.1) with native extensions
Installing postgres-pr (0.6.3)
Installing rack-rewrite (1.0.2)
Installing rack-timeout (0.0.3)
Using bundler (1.0.7)
Installing rails (3.0.3)
Installing thin (1.5.0) with native extensions
Installing time_diff (0.2.2)
事实
- 这些错误是间歇性的,我无法重现它们。
- 大多数情况下,搜索引擎机器人尝试访问该页面时似乎都会发生这种情况
问题
Q1。我什至不知道从哪里开始解决这个问题(你还需要我的代码的哪些其他部分?)。我的第一步应该是什么?
Q2。Rails 3.0.3 和 Postgresql 是否存在任何已知问题?
- 你还需要什么来帮助我解决问题?