我已经成功安装了 PostGIS 并使用postgres_ext
gem 添加了支持 Rails postgis
ActiveRecord 适配器,但是当我尝试在迁移中使用 Postgres 数组列类型时,它失败了:
t.string :pets, :array => true, :limit => 12
和错误:
rake aborted!
An error has occurred, this and all later migrations canceled:
undefined method `array' for #<ActiveRecord::ConnectionAdapters::ColumnDefinition:0x007fa8357b3308>
/Users/avishai/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.9/lib/active_support/core_ext/object/try.rb:36:in `try'
/Users/avishai/.rvm/gems/ruby-1.9.3-p194/gems/postgres_ext-0.0.9/lib/postgres_ext/active_record/connection_adapters/postgres_adapter.rb:197:in `add_column_options!'
/Users/avishai/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.9/lib/active_record/connection_adapters/abstract/schema_definitions.rb:38:in `add_column_options!'
/Users/avishai/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.9/lib/active_record/connection_adapters/abstract/schema_definitions.rb:31:in `to_sql'
/Users/avishai/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-postgis-adapter-0.4.3/lib/active_record/connection_adapters/postgis_adapter/spatial_table_definition.rb:76:in `block in to_sql'
/Users/avishai/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-postgis-adapter-0.4.3/lib/active_record/connection_adapters/postgis_adapter/spatial_table_definition.rb:76:in `map'
/Users/avishai/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-postgis-adapter-0.4.3/lib/active_record/connection_adapters/postgis_adapter/spatial_table_definition.rb:76:in `to_sql'
/Users/avishai/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-postgis-adapter-0.4.3/lib/active_record/connection_adapters/postgis_adapter/main_adapter.rb:192:in `create_table'
/Users/avishai/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.9/lib/active_record/migration.rb:466:in `block in method_missing'
/Users/avishai/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.9/lib/active_record/migration.rb:438:in `block in say_with_time'
/Users/avishai/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.9/lib/active_record/migration.rb:438:in `say_with_time'
/Users/avishai/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.9/lib/active_record/migration.rb:458:in `method_missing'
宝石文件:
gem "rails", "~> 3.2.9"
gem "airbrake"
gem "pg"
gem "postgres_ext"
gem "activerecord-postgis-adapter"
gem "activerecord-postgres-array", "~> 0.0.8"
任何想法如何解决这个问题?