ruby on rails - undefined method when trying to build db with activerecord-postgis-adapter -


i trying deploy rails application using activerecord-postgis-adapter heroku, keep getting error.

ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.3.0]

rails 3.2.13

$ heroku run rake db:schema:load running `rake db:schema:load` attached terminal... up, run.9233 deprecation warning: have rails 2.3-style plugins in vendor/plugins! support these plugins removed in rails 4.0. move them out , bundle them in gemfile, or fold them in app lib/myplugin/* , config/initializers/myplugin.rb. see release notes more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called <top (required)> @ /app/rakefile:7) deprecation warning: have rails 2.3-style plugins in vendor/plugins! support these plugins removed in rails 4.0. move them out , bundle them in gemfile, or fold them in app lib/myplugin/* , config/initializers/myplugin.rb. see release notes more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called <top (required)> @ /app/rakefile:7) -- create_table("active_admin_comments", {:force=>true})  ...  -- create_table("locations", {:force=>true}) rake aborted! undefined method `spatial' #<activerecord::connectionadapters::postgresqladapter::tabledefinition:0x007f6051920618> /app/vendor/bundle/ruby/2.0.0/gems/rgeo-activerecord-0.5.0/lib/rgeo/active_record/common_adapter_elements.rb:107:in `method_missing' /app/db/schema.rb:85:in `block (2 levels) in <top (required)>' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/schema_statements.rb:160:in `create_table' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/migration.rb:466:in `block in method_missing' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/migration.rb:438:in `block in say_with_time' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/migration.rb:438:in `say_with_time' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/migration.rb:458:in `method_missing' /app/db/schema.rb:80:in `block in <top (required)>' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/schema.rb:50:in `instance_eval' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/schema.rb:50:in `define' /app/db/schema.rb:14:in `<top (required)>' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `load' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `block in load' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `load' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:402:in `block (3 levels) in <top (required)>' /app/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:246:in `call' /app/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute' /app/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:241:in `each' /app/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute' /app/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain' /app/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain' /app/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke' /app/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task' /app/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:101:in `block (2 levels) in top_level' /app/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:101:in `each' /app/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:101:in `block in top_level' /app/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads' /app/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level' /app/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:73:in `block in run' /app/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling' /app/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:70:in `run' tasks: top => db:schema:load (see full trace running task --trace) 

this happened me when switched using unicorn web server. found had add special bit of code config/unicorn.rb make work:

# in config/unicorn.rb after_fork |server, worker|   if defined?(activerecord::base)     config = rails.application.config.database_configuration[rails.env]     config['adapter'] = 'postgis'     activerecord::base.establish_connection(config)   end end 

found answer here: https://devcenter.heroku.com/articles/postgis


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -