Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: uninitialized constant RGeo::ActiveRecord::SpatialToSql (NameError) after upgarding to newly released version 10 #416

Closed
upendra-azad opened this issue Nov 5, 2024 · 4 comments

Comments

@upendra-azad
Copy link

upendra-azad commented Nov 5, 2024

-- with rails 7.2

rails c
****/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-postgis-adapter-10.0.0/lib/active_record/connection_adapters/postgis/arel_tosql.rb:19:in `<top (required)>': uninitialized constant RGeo::ActiveRecord::SpatialToSql (NameError)

RGeo::ActiveRecord::SpatialToSql.prepend RGeo::ActiveRecord::SpatialToPostGISSql
^^^^^^^^^^^^^^
Did you mean? RGeo::ActiveRecord::SpatialToPostGISSql

@BuonOmo
Copy link
Member

BuonOmo commented Nov 5, 2024

Do you have a repository or file that helps with the reproduction ?

@upendra-azad
Copy link
Author

require_relative 'boot'
require 'rails/all'
require 'active_record/connection_adapters/postgis_adapter'
Bundler.require(*Rails.groups)

in my application.rb file these modules were being included.

adding require 'rgeo/active_record' in there fixed the issue.
earlier it didn't need to require this.

@BuonOmo
Copy link
Member

BuonOmo commented Nov 5, 2024

I think this is related to #414 then!

@shamil
Copy link

shamil commented Nov 13, 2024

@upendra-azad I've the same issue.

Even after adding require 'rgeo/active_record' id didn't help.
I'm not using rails directly. Here is my code

require "bundler/setup"
require "active_support/all"
require "active_record"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants