我的 rails 4 应用程序使用带有 activerecord-postgis-adapter 的 postgis。我正在尝试使用 Heroku CI。ci 运行在它到达 schema.rb 文件中的几何列描述时加载数据库结构时失败。
-----> Preparing test database
Running: rake db:schema:load_if_ruby
The PGconn, PGresult, and PGError constants are deprecated, and will be
removed as of version 1.0.
You should use PG::Connection, PG::Result, and PG::Error instead, respectively.
Called from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in `load_dependency'
rake aborted!
NoMethodError: undefined method `geometry' for #<ActiveRecord::ConnectionAdapters::PostgreSQL::TableDefinition:0x000055bd614ea1a0>
/app/db/schema.rb:105:in `block (2 levels) in <top (required)>'
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.11.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:216:in `create_table'
...
我的 database.yml 文件为所有环境指定了 postgis 适配器,所以看到它使用 postgresql 适配器我很惊讶。
有什么建议么?
我之前在sql中记录了数据库模式。我在 heroku 网站上找到了改用 ruby 的建议。那没有帮助。
测试在本地运行良好。