rgeo / activerecord-postgis-adapter

ActiveRecord connection adapter for PostGIS, based on postgresql and rgeo
Other
880 stars 242 forks source link

uninitialized constant ActiveRecord::ConnectionAdapters::PostgreSQL::ColumnDefinition (NameError) #410

Open asmrtfm opened 1 month ago

asmrtfm commented 1 month ago

activerecord-postgis-adapter (9.0.2) ruby versions tried: 3.2.4, 3.3.3 postgresql versions tried: 14, 16

I have followed all steps in the README, but whenever I get to the migration generator I always get the same error:

rails generate migration AddPostgisExtensionToDatabase


/home/me/.bundle/ruby/3.2.0/gems/activerecord-postgis-adapter-3.1.2/lib/active_record/connection_adapters/postgis/spatial_table_definition.rb:46:in `<module:PostGIS>': uninitialized constant ActiveRecord::ConnectionAdapters::PostgreSQL::ColumnDefinition (NameError)
  class ColumnDefinition < PostgreSQL::ColumnDefinition
                                     ^^^^^^^^^^^^^^^^^^

Did you mean? ActiveRecord::ConnectionAdapters::AddColumnDefinition from /home/me/.bundle/ruby/3.2.0/gems/activerecord-postgis-adapter-3.1.2/lib/active_record/connection_adapters/postgis/spatial_table_definition.rb:3:in <module:ConnectionAdapters>' from /home/me/.bundle/ruby/3.2.0/gems/activerecord-postgis-adapter-3.1.2/lib/active_record/connection_adapters/postgis/spatial_table_definition.rb:2:in' from /home/me/.bundle/ruby/3.2.0/gems/activerecord-postgis-adapter-3.1.2/lib/active_record/connection_adapters/postgis/spatial_table_definition.rb:1:in <main>' from <internal:/home/me/.asdf/installs/ruby/3.2.4/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:inrequire' from <internal:/home/me/.asdf/installs/ruby/3.2.4/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in require' from /home/me/.bundle/ruby/3.2.0/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:inrequire' from /home/me/.bundle/ruby/3.2.0/gems/zeitwerk-2.6.18/lib/zeitwerk/kernel.rb:34:in require' from /home/me/.bundle/ruby/3.2.0/gems/activerecord-postgis-adapter-3.1.2/lib/active_record/connection_adapters/postgis_adapter.rb:12:in

' from <internal:/home/me/.asdf/installs/ruby/3.2.4/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in require' from <internal:/home/me/.asdf/installs/ruby/3.2.4/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:inrequire' from /home/me/.bundle/ruby/3.2.0/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require' from /home/me/.bundle/ruby/3.2.0/gems/zeitwerk-2.6.18/lib/zeitwerk/kernel.rb:34:inrequire' from /home/me/.bundle/ruby/3.2.0/gems/activerecord-postgis-adapter-3.1.2/lib/activerecord-postgis-adapter.rb:1:in <main>' from /home/me/.bundle/ruby/3.2.0/gems/zeitwerk-2.6.18/lib/zeitwerk/kernel.rb:34:inrequire' from /home/me/.bundle/ruby/3.2.0/gems/zeitwerk-2.6.18/lib/zeitwerk/kernel.rb:34:in require' from /home/me/.asdf/installs/ruby/3.2.4/lib/ruby/3.2.0/bundler/runtime.rb:60:inblock (2 levels) in require' from /home/me/.asdf/installs/ruby/3.2.4/lib/ruby/3.2.0/bundler/runtime.rb:55:in each' from /home/me/.asdf/installs/ruby/3.2.4/lib/ruby/3.2.0/bundler/runtime.rb:55:inblock in require' from /home/me/.asdf/installs/ruby/3.2.4/lib/ruby/3.2.0/bundler/runtime.rb:44:in each' from /home/me/.asdf/installs/ruby/3.2.4/lib/ruby/3.2.0/bundler/runtime.rb:44:inrequire' from /home/me/.asdf/installs/ruby/3.2.4/lib/ruby/3.2.0/bundler.rb:187:in require' from /home/me/.src/github/asmrtfm/neptune_spear/moonlite/config/application.rb:7:in
' from <internal:/home/me/.asdf/installs/ruby/3.2.4/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in require' from <internal:/home/me/.asdf/installs/ruby/3.2.4/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:inrequire' from /home/me/.bundle/ruby/3.2.0/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require' from /home/me/.bundle/ruby/3.2.0/gems/railties-7.2.1/lib/rails/command/actions.rb:15:inrequire_application!' from /home/me/.bundle/ruby/3.2.0/gems/railties-7.2.1/lib/rails/command/actions.rb:19:in boot_application!' from /home/me/.bundle/ruby/3.2.0/gems/railties-7.2.1/lib/rails/commands/generate/generate_command.rb:21:inperform' from /home/me/.bundle/ruby/3.2.0/gems/thor-1.3.2/lib/thor/command.rb:28:in run' from /home/me/.bundle/ruby/3.2.0/gems/thor-1.3.2/lib/thor/invocation.rb:127:ininvoke_command' from /home/me/.bundle/ruby/3.2.0/gems/railties-7.2.1/lib/rails/command/base.rb:178:in invoke_command' from /home/me/.bundle/ruby/3.2.0/gems/thor-1.3.2/lib/thor.rb:538:indispatch' from /home/me/.bundle/ruby/3.2.0/gems/railties-7.2.1/lib/rails/command/base.rb:73:in perform' from /home/me/.bundle/ruby/3.2.0/gems/railties-7.2.1/lib/rails/command.rb:71:inblock in invoke' from /home/me/.bundle/ruby/3.2.0/gems/railties-7.2.1/lib/rails/command.rb:149:in with_argv' from /home/me/.bundle/ruby/3.2.0/gems/railties-7.2.1/lib/rails/command.rb:69:ininvoke' from /home/me/.bundle/ruby/3.2.0/gems/railties-7.2.1/lib/rails/commands.rb:18:in <main>' from <internal:/home/me/.asdf/installs/ruby/3.2.4/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:inrequire' from <internal:/home/me/.asdf/installs/ruby/3.2.4/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in require' from /home/me/.bundle/ruby/3.2.0/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:inrequire' from bin/rails:4:in `
'

BuonOmo commented 1 month ago

Could it be related to https://github.com/rgeo/activerecord-postgis-adapter/issues/357 ? You are using rails 7.2.1 which is not yet supported. See #405 and try the branch bump-7-2.