danielM
danielM

Reputation: 2512

Heroku will not launch because of spatial adapter error

I'm trying to deploy a Rails application to Heroku that uses PostGIS for some location-based information. I followed Heroku's documentation on installing PostGIS (https://devcenter.heroku.com/articles/postgis) on my database but I'm encountering the following error from the spatial_adapter gem:

/app/vendor/bundle/ruby/1.9.1/gems/spatial_adapter-1.2.0/lib/spatial_adapter/railtie.rb:4:in `block in <class:Railtie>': undefined method `[]' for nil:NilClass (NoMethodError)
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /app/config/environment.rb:5:in `<top (required)>'
from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/application.rb:103:in `require_environment!'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:40:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

Any ideas about what's causing this error? Thanks in advance!

Upvotes: 1

Views: 214

Answers (1)

danielM
danielM

Reputation: 2512

The github page for the spatial_adapter gem says that this adapter is no longer being maintained and that the RGeo gem should be used instead. I used the following tutorial to convert my application to the new gem: http://www.waratuman.com/2012/10/26/postgis_and_rails/

Problem solved!

Upvotes: 4

Related Questions