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

PostGIS on active record 5+ #170

Open
bleonard opened this issue Aug 25, 2017 · 3 comments
Open

PostGIS on active record 5+ #170

bleonard opened this issue Aug 25, 2017 · 3 comments

Comments

@bleonard
Copy link
Contributor

bleonard commented Aug 25, 2017

@kbacha if I allow the postgis spec to run >= 5, it gives this error.

/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/rgeo-0.6.0/lib/rgeo/wkrep/wkt_parser.rb:153:in `_ensure_factory'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/rgeo-0.6.0/lib/rgeo/wkrep/wkt_parser.rb:237:in `_parse_coords'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/rgeo-0.6.0/lib/rgeo/wkrep/wkt_parser.rb:263:in `_parse_point'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/rgeo-0.6.0/lib/rgeo/wkrep/wkt_parser.rb:198:in `_parse_type_tag'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/rgeo-0.6.0/lib/rgeo/wkrep/wkt_parser.rb:131:in `parse'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-postgis-adapter-5.0.2/lib/active_record/connection_adapters/postgis/oid/spatial.rb:95:in `parse_wkt'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-postgis-adapter-5.0.2/lib/active_record/connection_adapters/postgis/oid/spatial.rb:90:in `cast_value'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activemodel-5.1.2/lib/active_model/type/value.rb:36:in `cast'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/attribute.rb:173:in `type_cast'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/attribute.rb:38:in `value'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/attribute.rb:154:in `changed_from_assignment?'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/attribute.rb:55:in `changed?'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/attribute_mutation_tracker.rb:41:in `changed?'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/attribute_mutation_tracker.rb:29:in `change_to_attribute'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/attribute_mutation_tracker.rb:21:in `block in changes'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/attribute_mutation_tracker.rb:20:in `each'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/attribute_mutation_tracker.rb:20:in `each_with_object'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/attribute_mutation_tracker.rb:20:in `changes'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/attribute_methods/dirty.rb:201:in `changes_to_save'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/attribute_methods/dirty.rb:206:in `changed_attribute_names_to_save'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/attribute_methods/dirty.rb:300:in `keys_for_partial_write'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/attribute_methods/dirty.rb:296:in `_create_record'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/callbacks.rb:340:in `block in _create_record'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/callbacks.rb:131:in `run_callbacks'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/callbacks.rb:825:in `_run_create_callbacks'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/callbacks.rb:340:in `_create_record'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/timestamp.rb:95:in `_create_record'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/persistence.rb:563:in `create_or_update'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/callbacks.rb:336:in `block in create_or_update'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/callbacks.rb:97:in `run_callbacks'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/callbacks.rb:825:in `_run_save_callbacks'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/callbacks.rb:336:in `create_or_update'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/persistence.rb:162:in `save!'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/validations.rb:50:in `save!'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/attribute_methods/dirty.rb:43:in `save!'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/transactions.rb:313:in `block in save!'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/transactions.rb:384:in `block in with_transaction_returning_status'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/connection_adapters/abstract/database_statements.rb:225:in `block in transaction'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/connection_adapters/abstract/transaction.rb:194:in `block in within_new_transaction'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/connection_adapters/abstract/transaction.rb:191:in `within_new_transaction'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/connection_adapters/abstract/database_statements.rb:225:in `transaction'
(eval):61:in `block in transaction'
(eval):15:in `_makara_hijack'
(eval):57:in `transaction'
/Users/brian/taskrabbit/makara/lib/makara/connection_wrapper.rb:102:in `public_send'
/Users/brian/taskrabbit/makara/lib/makara/connection_wrapper.rb:102:in `method_missing'
/Users/brian/taskrabbit/makara/lib/makara/proxy.rb:28:in `block (3 levels) in hijack_method'
/Users/brian/taskrabbit/makara/lib/active_record/connection_adapters/makara_abstract_adapter.rb:160:in `block in appropriate_connection'
/Users/brian/taskrabbit/makara/lib/makara/proxy.rb:173:in `block (3 levels) in appropriate_connection'
/Users/brian/taskrabbit/makara/lib/makara/proxy.rb:245:in `hijacked'
/Users/brian/taskrabbit/makara/lib/makara/proxy.rb:172:in `block (2 levels) in appropriate_connection'
/Users/brian/taskrabbit/makara/lib/makara/pool.rb:105:in `block in provide'
/Users/brian/taskrabbit/makara/lib/active_record/connection_adapters/makara_abstract_adapter.rb:37:in `handle'
/Users/brian/taskrabbit/makara/lib/makara/pool.rb:104:in `provide'
/Users/brian/taskrabbit/makara/lib/makara/proxy.rb:171:in `block in appropriate_connection'
/Users/brian/taskrabbit/makara/lib/makara/proxy.rb:186:in `appropriate_pool'
/Users/brian/taskrabbit/makara/lib/makara/proxy.rb:170:in `appropriate_connection'
/Users/brian/taskrabbit/makara/lib/active_record/connection_adapters/makara_abstract_adapter.rb:159:in `appropriate_connection'
/Users/brian/taskrabbit/makara/lib/makara/proxy.rb:27:in `block (2 levels) in hijack_method'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/transactions.rb:210:in `transaction'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/transactions.rb:381:in `with_transaction_returning_status'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/transactions.rb:313:in `save!'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/suppressor.rb:46:in `save!'
/Users/brian/.rbenv/versions/2.3.2/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/persistence.rb:51:in `create!'
/Users/brian/taskrabbit/makara/spec/active_record/connection_adapters/makara_postgis_adapter_spec.rb:111:in `block (3 levels) in <top (required)>'

Probably be good to fix. Some rgeo issue?

@choubacha
Copy link
Contributor

@bleonard Not sure, what's the actual error? The stack trace doesn't seem to include it.

@bleonard
Copy link
Contributor Author

oh sorry. it was trying to call .properties on nil in rgeo at that top line.

@choubacha
Copy link
Contributor

@bleonard I think i've seen that before when rgeo doesn't initialize correctly. It doesn't tell you why it just returns null.

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

No branches or pull requests

2 participants