私はGeoRuby(1.3.4)とspatial_adapter(1.1.2)の宝石を使用しているので、私はMySQLの空間拡張を使用しているRails(2.3.4)アプリケーションで作業しています。ActiveSupport.remove_constant - Exception NameError
私はしかしGeoRubyのPointオブジェクトを使用して開始して以来activesupportの要求を処理した後に、定数を削除しようとしたとき、私はトラブルに実行している:
[ pid=18105 thr=67398490 file=utils.rb:176 time=2010-12-07 15:00:38.894 ]: *** Exception NameError in application (cannot remove Object::Geometry) (process 18105, thread #<Thread:0x808d6b4>):
from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:603:in `remove_const'
from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:603:in `remove_constant'
from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:603:in `instance_eval'
from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:603:in `remove_constant'
from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:450:in `remove_unloadable_constants!'
from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:450:in `each'
from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:450:in `remove_unloadable_constants!'
from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:236:in `clear'
from /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/dispatcher.rb:64:in `cleanup_application'
from /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/reloader.rb:17:in `close'
from /opt/local/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/rack/request_handler.rb:136:in `process_request'
from /opt/local/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
from /opt/local/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
from /opt/local/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/classic_rails/application_spawner.rb:321:in `start_request_handler'
from /opt/local/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `send'
from /opt/local/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `handle_spawn_application'
from /opt/local/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/utils.rb:479:in `safe_fork'
from /opt/local/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/classic_rails/application_spawner.rb:270:in `handle_spawn_application'
from /opt/local/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/abstract_server.rb:357:in `__send__'
from /opt/local/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
from /opt/local/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
from /opt/local/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/abstract_server.rb:180:in `start'
from /opt/local/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/classic_rails/application_spawner.rb:149:in `start'
from /opt/local/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/spawn_manager.rb:219:in `spawn_rails_application'
from /opt/local/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
from /opt/local/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/spawn_manager.rb:214:in `spawn_rails_application'
from /opt/local/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/abstract_server_collection.rb:82:in `synchronize'
from /opt/local/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
from /opt/local/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/spawn_manager.rb:213:in `spawn_rails_application'
from /opt/local/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/spawn_manager.rb:132:in `spawn_application'
from /opt/local/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
from /opt/local/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/abstract_server.rb:357:in `__send__'
from /opt/local/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
from /opt/local/lib/ruby/gems/1.8/gems/passenger-3.0.0/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
from /opt/local/lib/ruby/gems/1.8/gems/passenger-3.0.0/helper-scripts/passenger-spawn-server:99
結局、これはApacheがSIGTERMを受信する原因となっているが(おそらくそれはスレッドや何かをexhausingしているので)、サーバは時折リクエストに応答できません。
「Object :: Geometry」は奇妙なことですが、GeoRuby :: SimpleFeatures :: Geometryを読み込むことを期待しています(GeoRuby :: SimpleFeatures :: Pointを使用しています。 Geometryのサブクラス)。
また、ActiveSupport 3.0.0ではremove_constantのコードが、私が使用しているバージョンとどのように違うのか気づきました。このアップデートはこの問題を修正しますか?もしそうなら、それはRails 3.0へのアップデートを必要としますか?