Postgres 还是database_cleaner?
我遇到了一个非常奇怪的案例。我有这种情况,有时它会过去。有时则不然。事实上,每个步骤都是绿色的,但是在该步骤之后它会生成这个垃圾堆栈跟踪,它不会告诉我有关我的应用程序的任何信息。
我在这里并没有做任何复杂的事情,只是想用 TinyMCE 创建一个该死的评论。我还有 20 个其他场景,其中一些要复杂得多。
它可能有助于说明我的环境,尽管从堆栈跟踪中非常明显:
Rails 3.1、ruby 1.9.2、所有内容的最新“稳定”版本。 Postgres 9.0.4。
有比我聪明的人能解释一下为什么我会遇到这个问题吗?
Feature: Payment object comments
In order to explain a action I performed on a payment object
As a user
I want to make a comment
@wip @javascript
Scenario: Creating a comment # features/payment_objects/comments.feature:8
[paperclip] Saving attachments.
[paperclip] Saving attachments.
[paperclip] Saving attachments.
Given I am in a company # features/step_definitions/application_steps.rb:1
And I have created 1 cash requisitions # features/step_definitions/payment_steps.rb:5
When I am on the requisitions page # features/step_definitions/web_steps.rb:44
And I click on the 1st requisition # features/step_definitions/payment_steps.rb:39
When I open the Comments tab # features/step_definitions/payment_steps.rb:101
http://127.0.0.1:51796/assets/tinymce/plugins/spellchecker/editor_plugin.js?3.4.5:1 Error: Sprockets::EncodingError: /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/tinymce-rails-3.4.5/assets/precompiled/tinymce/plugins/spellchecker/editor_plugin.js has a invalid UTF-8 byte sequence
When I fill in "comment_content" with "Testing123" # features/step_definitions/web_steps.rb:64
And I click on "Comment" # features/step_definitions/web_steps.rb:52
Then there should be a comment saying "Testing123" # features/step_definitions/payment_steps.rb:106
http://127.0.0.1:51796/assets/tinymce/plugins/spellchecker/editor_plugin.js?3.4.5:1 Error: Sprockets::EncodingError: /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/tinymce-rails-3.4.5/assets/precompiled/tinymce/plugins/spellchecker/editor_plugin.js has a invalid UTF-8 byte sequence
NoMethodError: undefined method `nfields' for nil:NilClass: SELECT tablename
FROM pg_tables
WHERE schemaname = ANY (current_schemas(false))
(ActiveRecord::StatementInvalid)
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.0/lib/active_support/whiny_nil.rb:48:in `method_missing'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:490:in `result_as_array'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:533:in `block in query'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract_adapter.rb:244:in `block in log'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.0/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract_adapter.rb:239:in `log'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:532:in `query'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:666:in `tables'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:455:in `disable_referential_integrity'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/database_cleaner-0.6.7/lib/database_cleaner/active_record/truncation.rb:113:in `each_table'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/database_cleaner-0.6.7/lib/database_cleaner/active_record/truncation.rb:106:in `clean'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/database_cleaner-0.6.7/lib/database_cleaner/base.rb:77:in `clean'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/database_cleaner-0.6.7/lib/database_cleaner/configuration.rb:56:in `block in clean'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/database_cleaner-0.6.7/lib/database_cleaner/configuration.rb:56:in `each'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/database_cleaner-0.6.7/lib/database_cleaner/configuration.rb:56:in `clean'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-rails-1.0.2/lib/cucumber/rails/hooks/database_cleaner.rb:9:in `After'
I'm running into a very strange case. I have this scenario and sometimes it passes. Sometimes it doesn't. In fact, every step is green, but then after the step it produces this garbage stack trace which doesn't tell me anything about my app.
And I'm not doing anything sophisticated here, just simply trying to create a damn comment with TinyMCE. I have 20 other scenarios, some of which are much more complex.
It might help to state my environment all though it's pretty obvious from the stack trace:
Rails 3.1, ruby 1.9.2, latest "stable" version of everything. Postgres 9.0.4.
Could someone smarter than me explain why I get this issue?
Feature: Payment object comments
In order to explain a action I performed on a payment object
As a user
I want to make a comment
@wip @javascript
Scenario: Creating a comment # features/payment_objects/comments.feature:8
[paperclip] Saving attachments.
[paperclip] Saving attachments.
[paperclip] Saving attachments.
Given I am in a company # features/step_definitions/application_steps.rb:1
And I have created 1 cash requisitions # features/step_definitions/payment_steps.rb:5
When I am on the requisitions page # features/step_definitions/web_steps.rb:44
And I click on the 1st requisition # features/step_definitions/payment_steps.rb:39
When I open the Comments tab # features/step_definitions/payment_steps.rb:101
http://127.0.0.1:51796/assets/tinymce/plugins/spellchecker/editor_plugin.js?3.4.5:1 Error: Sprockets::EncodingError: /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/tinymce-rails-3.4.5/assets/precompiled/tinymce/plugins/spellchecker/editor_plugin.js has a invalid UTF-8 byte sequence
When I fill in "comment_content" with "Testing123" # features/step_definitions/web_steps.rb:64
And I click on "Comment" # features/step_definitions/web_steps.rb:52
Then there should be a comment saying "Testing123" # features/step_definitions/payment_steps.rb:106
http://127.0.0.1:51796/assets/tinymce/plugins/spellchecker/editor_plugin.js?3.4.5:1 Error: Sprockets::EncodingError: /Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/tinymce-rails-3.4.5/assets/precompiled/tinymce/plugins/spellchecker/editor_plugin.js has a invalid UTF-8 byte sequence
NoMethodError: undefined method `nfields' for nil:NilClass: SELECT tablename
FROM pg_tables
WHERE schemaname = ANY (current_schemas(false))
(ActiveRecord::StatementInvalid)
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.0/lib/active_support/whiny_nil.rb:48:in `method_missing'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:490:in `result_as_array'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:533:in `block in query'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract_adapter.rb:244:in `block in log'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.0/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract_adapter.rb:239:in `log'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:532:in `query'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:666:in `tables'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:455:in `disable_referential_integrity'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/database_cleaner-0.6.7/lib/database_cleaner/active_record/truncation.rb:113:in `each_table'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/database_cleaner-0.6.7/lib/database_cleaner/active_record/truncation.rb:106:in `clean'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/database_cleaner-0.6.7/lib/database_cleaner/base.rb:77:in `clean'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/database_cleaner-0.6.7/lib/database_cleaner/configuration.rb:56:in `block in clean'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/database_cleaner-0.6.7/lib/database_cleaner/configuration.rb:56:in `each'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/database_cleaner-0.6.7/lib/database_cleaner/configuration.rb:56:in `clean'
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-rails-1.0.2/lib/cucumber/rails/hooks/database_cleaner.rb:9:in `After'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当我运行时,我收到了资产管道和tiny_mce的类似问题
...我尝试使用 iconv 等转换文件 editor_plugin_src.js 和 editor_plugin.js ,但最终只是暂时删除它们,一切正常。我正计划“正确修复它”,但如果您不需要拼写检查器,则可能不需要这些文件......
I received a similar issue with the asset pipeline and tiny_mce when I would run
...I tried converting the files editor_plugin_src.js and editor_plugin.js with iconv, etc, but ended up just deleting them for the time being, and everything worked. I'm planning on "fixing it right," but if you don't need the spellchecker, you may not need these files...