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:block 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ブロック内log' /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/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/database_cleaner-0.8.0/lib/database_cleaner/active_record/truncation.rb:132:inclean' /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' / Users/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/ report.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:innew' /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: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:in実行中' /Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/drb/drb.rb:1548:perform_without_block' /Users/OyoKooN/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/drb/drb.rb:1508:in実行中' /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 `main_loop のブロック'

ありがとう。

4

0 に答える 0