ENV:
- ruby '3.2.2'
- gem 'geokit-rails', '~> 2.3', '>= 2.3.1'
- gem 'rails', '~> 7.1.2'
- production env: Heroku
Details
- I have a Property() Model that geocodes after update on a
property_address
field
property.update!(property_address: '1 Hacker Way, Menlo Park, CA')
works fine in the rails console locally but fails in heroku
- I do have a Google Geocoding API key setup and I can guarantee I have not exceeded any kind of quota limit
- There seems to be an issue with the request that geokit sends to geocoding google api, where google is expecting a level of security (https) that is not properly configured in my config for geokit, but I can't tell what or how would I do this.
- The error thrown:
irb(main):005> p.update(property_address: '1 Hacker Way, Menlo Park, CA')
E, [2023-12-14T15:03:58.135258 #2] ERROR -- : Caught an error during Google geocoding call: class variable @@secure of Geokit::Geocoders::GoogleGeocoder is overtaken by Geokit::Geocoders
E, [2023-12-14T15:03:58.135412 #2] ERROR -- : (eval):6:in `secure'
/app/vendor/bundle/ruby/3.2.0/gems/geokit-1.14.0/lib/geokit/geocoders.rb:156:in `use_https?'
/app/vendor/bundle/ruby/3.2.0/gems/geokit-1.14.0/lib/geokit/geocoders.rb:160:in `protocol'
/app/vendor/bundle/ruby/3.2.0/gems/geokit-1.14.0/lib/geokit/geocoders/google.rb:90:in `submit_url'
/app/vendor/bundle/ruby/3.2.0/gems/geokit-1.14.0/lib/geokit/geocoders/google.rb:63:in `do_geocode'
/app/vendor/bundle/ruby/3.2.0/gems/geokit-1.14.0/lib/geokit/geocoders.rb:92:in `geocode'
/app/vendor/bundle/ruby/3.2.0/gems/geokit-1.14.0/lib/geokit/multi_geocoder.rb:34:in `block in do_geocode'
/app/vendor/bundle/ruby/3.2.0/gems/geokit-1.14.0/lib/geokit/multi_geocoder.rb:31:in `each'
/app/vendor/bundle/ruby/3.2.0/gems/geokit-1.14.0/lib/geokit/multi_geocoder.rb:31:in `do_geocode'
/app/vendor/bundle/ruby/3.2.0/gems/geokit-1.14.0/lib/geokit/geocoders.rb:92:in `geocode'
/app/app/models/property.rb:97:in `geocode_address'
/app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/callbacks.rb:403:in `block in make_lambda'
/app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/callbacks.rb:239:in `block in halting_and_conditional'
/app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/callbacks.rb:602:in `block in invoke_after'
/app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/callbacks.rb:602:in `each'
/app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/callbacks.rb:602:in `invoke_after'
/app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/callbacks.rb:111:in `run_callbacks'
/app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/callbacks.rb:952:in `_run_update_callbacks'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.2/lib/active_record/callbacks.rb:449:in `_update_record'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.2/lib/active_record/timestamp.rb:120:in `_update_record'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.2/lib/active_record/persistence.rb:1220:in `create_or_update'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.2/lib/active_record/callbacks.rb:441:in `block in create_or_update'
/app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.2/lib/active_record/autosave_association.rb:375:in `around_save_collection_association'
/app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/callbacks.rb:130:in `block in run_callbacks'
/app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/callbacks.rb:141:in `run_callbacks'
/app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/callbacks.rb:952:in `_run_save_callbacks'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.2/lib/active_record/callbacks.rb:441:in `create_or_update'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.2/lib/active_record/timestamp.rb:125:in `create_or_update'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.2/lib/active_record/persistence.rb:718:in `save'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.2/lib/active_record/validations.rb:49:in `save'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.2/lib/active_record/transactions.rb:309:in `block in save'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.2/lib/active_record/transactions.rb:365:in `block in with_transaction_returning_status'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.2/lib/active_record/connection_adapters/abstract/database_statements.rb:342:in `transaction'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.2/lib/active_record/transactions.rb:361:in `with_transaction_returning_status'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.2/lib/active_record/transactions.rb:309:in `save'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.2/lib/active_record/suppressor.rb:52:in `save'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.2/lib/active_record/persistence.rb:895:in `block in update'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.2/lib/active_record/transactions.rb:365:in `block in with_transaction_returning_status'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.2/lib/active_record/connection_adapters/abstract/transaction.rb:535:in `block in within_new_transaction'
/app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.2/lib/active_record/connection_adapters/abstract/transaction.rb:532:in `within_new_transaction'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.2/lib/active_record/connection_adapters/abstract/database_statements.rb:344:in `transaction'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.2/lib/active_record/transactions.rb:361:in `with_transaction_returning_status'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.2/lib/active_record/persistence.rb:893:in `update'
(irb):5:in `<main>'
/app/vendor/bundle/ruby/3.2.0/gems/irb-1.10.1/lib/irb/workspace.rb:117:in `eval'
/app/vendor/bundle/ruby/3.2.0/gems/irb-1.10.1/lib/irb/workspace.rb:117:in `evaluate'
/app/vendor/bundle/ruby/3.2.0/gems/irb-1.10.1/lib/irb/context.rb:570:in `evaluate'
/app/vendor/bundle/ruby/3.2.0/gems/irb-1.10.1/lib/irb.rb:516:in `block (2 levels) in eval_input'
/app/vendor/bundle/ruby/3.2.0/gems/irb-1.10.1/lib/irb.rb:828:in `signal_status'
/app/vendor/bundle/ruby/3.2.0/gems/irb-1.10.1/lib/irb.rb:509:in `block in eval_input'
/app/vendor/bundle/ruby/3.2.0/gems/irb-1.10.1/lib/irb.rb:591:in `block in each_top_level_statement'
/app/vendor/bundle/ruby/3.2.0/gems/irb-1.10.1/lib/irb.rb:586:in `loop'
/app/vendor/bundle/ruby/3.2.0/gems/irb-1.10.1/lib/irb.rb:586:in `each_top_level_statement'
/app/vendor/bundle/ruby/3.2.0/gems/irb-1.10.1/lib/irb.rb:508:in `eval_input'
/app/vendor/bundle/ruby/3.2.0/gems/irb-1.10.1/lib/irb.rb:495:in `block in run'
/app/vendor/bundle/ruby/3.2.0/gems/irb-1.10.1/lib/irb.rb:494:in `catch'
/app/vendor/bundle/ruby/3.2.0/gems/irb-1.10.1/lib/irb.rb:494:in `run'
/app/vendor/bundle/ruby/3.2.0/gems/irb-1.10.1/lib/irb.rb:396:in `start'
/app/vendor/bundle/ruby/3.2.0/gems/railties-7.1.2/lib/rails/commands/console/console_command.rb:78:in `start'
/app/vendor/bundle/ruby/3.2.0/gems/railties-7.1.2/lib/rails/commands/console/console_command.rb:16:in `start'
/app/vendor/bundle/ruby/3.2.0/gems/railties-7.1.2/lib/rails/commands/console/console_command.rb:106:in `perform'
/app/vendor/bundle/ruby/3.2.0/gems/thor-1.3.0/lib/thor/command.rb:28:in `run'
/app/vendor/bundle/ruby/3.2.0/gems/thor-1.3.0/lib/thor/invocation.rb:127:in `invoke_command'
/app/vendor/bundle/ruby/3.2.0/gems/railties-7.1.2/lib/rails/command/base.rb:178:in `invoke_command'
/app/vendor/bundle/ruby/3.2.0/gems/thor-1.3.0/lib/thor.rb:527:in `dispatch'
/app/vendor/bundle/ruby/3.2.0/gems/railties-7.1.2/lib/rails/command/base.rb:73:in `perform'
/app/vendor/bundle/ruby/3.2.0/gems/railties-7.1.2/lib/rails/command.rb:71:in `block in invoke'
/app/vendor/bundle/ruby/3.2.0/gems/railties-7.1.2/lib/rails/command.rb:149:in `with_argv'
/app/vendor/bundle/ruby/3.2.0/gems/railties-7.1.2/lib/rails/command.rb:69:in `invoke'
/app/vendor/bundle/ruby/3.2.0/gems/railties-7.1.2/lib/rails/commands.rb:18:in `<main>'
<internal:/app/vendor/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/app/vendor/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/app/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
What does your initializer look like? Be sure you have
This is mine