1

我根据以下教程使用我的 Rails 应用程序设置了 PostGIS:http ://www.daniel-azuma.com/blog/archives/69

当我尝试使用 Guard 运行测试时,出现以下错误: Exception encountered: #<ActiveRecord::StatementInvalid: PG::Error: ERROR: must be owner of relation spatial_ref_sys: ALTER TABLE "spatial_ref_sys" ENABLE TRIGGER ALL>

我已将 postgis 模式的所有者更改为我的“普通”数据库用户。我还在测试中使用数据库清理器。

完整的回溯如下:

/Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rack-mini-profiler-0.1.18/lib/patches/sql_patches.rb:155:in exec' /Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rack-mini-profiler-0.1.18/lib/patches/sql_patches.rb:155:inasync_exec ' /Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb:654:inblock in execute' /Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/abstract_adapter.rb:280:in块日志'/Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/activesupport-3.2.7/lib/active_support/notifications/instrumenter.rb:20:in instrument' /Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/abstract_adapter.rb:275:inlog ' /Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb:653:inexecute' /Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb:530:in确保在 disable_referential_integrity'/Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb:530 中:在disable_referential_integrity' /Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/database_cleaner-0.8.0/lib/database_cleaner/active_record/truncation.rb:132:in干净'/Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/database_cleaner-0.8.0/lib/database_cleaner/base.rb:39:inclean_with' /Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/database_cleaner-0.8.0/lib/database_cleaner/configuration.rb:62:in块clean_with' /Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/database_cleaner-0.8.0/lib/database_cleaner/configuration.rb:62:in each' /Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/database_cleaner-0.8.0/lib/database_cleaner/configuration.rb:62:inclean_with' /用户/OyoKooN/Projects/sos_medecins/spec/spec_helper.rb:50:in block (3 levels) in <top (required)>' /Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:23:ininstance_eval' /Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rspec-core -2.11.1/lib/rspec/core/hooks.rb:23:inrun' /Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:72:in阻止运行'/Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb: 72:each' /Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb:72:in运行中'/Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/hooks.rb :424:in run_hook' /Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:27:inblock in run' /Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/记者.rb:34:report' /Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:25:in运行中'/Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-1.0.0rc3/lib/spork/test_framework/rspec .rb:11:in run_tests' /Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-1.0.0rc3/lib/spork/run_strategy/forking.rb:13:inblock in run' /Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-1.0.0rc3/lib/spork/forker。 rb:21:in block in initialize' /Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-1.0.0rc3/lib/spork/forker.rb:18:infork' /Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-1.0.0rc3/lib/spork/forker.rb:18 :在initialize' /Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-1.0.0rc3/lib/spork/run_strategy/forking.rb:9:in新的'/Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-1.0.0rc3/lib/spork/run_strategy/forking.rb:9:in run' /Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/spork-1.0.0rc3/lib/spork/server.rb:48:inrun ' /Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/drb/drb.rb:1548:in perform_without_block' /Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/drb/drb.rb:1508:inperform' /Users/OyoKooN/.rbenv/versions/1.9.3- p194/lib/ruby/1.9.1/drb/drb.rb:1586:in block (2 levels) in main_loop' /Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/drb/drb.rb:1582:inloop' /Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/drb/drb.rb :1582:in `block in main_loop'

谢谢。

4

0 回答 0