【问题标题】:Heroku will not launch because of spatial adapter error由于空间适配器错误,Heroku 无法启动
【发布时间】:2013-09-12 02:27:27
【问题描述】:

我正在尝试将 Rails 应用程序部署到 Heroku,该应用程序使用 PostGIS 获取一些基于位置的信息。我遵循 Heroku 关于在我的数据库上安装 PostGIS (https://devcenter.heroku.com/articles/postgis) 的文档,但我遇到了来自 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>'

关于导致此错误的原因有什么想法吗?提前致谢!

【问题讨论】:

    标签: ruby-on-rails ruby heroku postgis


    【解决方案1】:

    spatial_adapter gem 的 github 页面说这个适配器不再被维护,应该使用 RGeo gem。我使用以下教程将我的应用程序转换为新的 gem:http://www.waratuman.com/2012/10/26/postgis_and_rails/

    问题解决了!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-04
      • 2014-11-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多