{"action":"created","issue":{"url":"https://api.github.com/repos/rgeo/activerecord-postgis-adapter/issues/185","labels_url":"https://api.github.com/repos/rgeo/activerecord-postgis-adapter/issues/185/labels{/name}","comments_url":"https://api.github.com/repos/rgeo/activerecord-postgis-adapter/issues/185/comments","events_url":"https://api.github.com/repos/rgeo/activerecord-postgis-adapter/issues/185/events","html_url":"https://github.com/rgeo/activerecord-postgis-adapter/issues/185","id":88270808,"number":185,"title":"NoMethodError set_rgeo_factory_for_column using activerecord_postgis_adapter","user":{"login":"oyeanuj","id":9633371,"avatar_url":"https://avatars.githubusercontent.com/u/9633371?v=3","gravatar_id":"","url":"https://api.github.com/users/oyeanuj","html_url":"https://github.com/oyeanuj","followers_url":"https://api.github.com/users/oyeanuj/followers","following_url":"https://api.github.com/users/oyeanuj/following{/other_user}","gists_url":"https://api.github.com/users/oyeanuj/gists{/gist_id}","starred_url":"https://api.github.com/users/oyeanuj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oyeanuj/subscriptions","organizations_url":"https://api.github.com/users/oyeanuj/orgs","repos_url":"https://api.github.com/users/oyeanuj/repos","events_url":"https://api.github.com/users/oyeanuj/events{/privacy}","received_events_url":"https://api.github.com/users/oyeanuj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-15T00:03:29Z","updated_at":"2015-06-17T06:33:47Z","closed_at":null,"body":"Apologies if this is very newbie question, but I have tried to solve it for a couple of days with zero luck.\r\n\r\nI tried installing activerecord-postgis-adapter as per the README but am unable to create the model instance as I keep getting the error mentioned below on the code pasted below that.\r\nNoMethodError: undefined method `set_rgeo_factory_for_column'\r\n\r\nHere are what my different files look like:\r\n\r\nLocation.rb (the model)\r\n`#self.rgeo_factory_generator = RGeo::Geos.factory_generator`\r\n` set_rgeo_factory_for_column(:coordinates, \r\n RGeo::Geographic.spherical_factory(:srid => 4326) )`\r\n\r\nConsole\r\n`irb(main):001:0> loc = Location.create`\r\n`NoMethodError: undefined method` `set_rgeo_factory_for_column' for Location`\r\n\r\n\r\nGemfile\r\n`gem 'rgeo'`\r\n`gem 'rgeo-activerecord'`\r\n`gem 'activerecord-postgis-adapter'`\r\n\r\nconfig/application.rb\r\n`require 'rails/all'`\r\n`#require 'active_record/connection_adapters/postgis_adapter/railtie'`\r\n`#require \"#{Rails.root}/lib/rgeo\"`\r\n\r\nconfig/database.yml\r\n`development:`\r\n  `<<: *default`\r\n  `database: geoproject-api_development`\r\n  `adapter: postgis`\r\n  `schema_search_path: \"public,postgis\"`\r\n\r\n\r\nThe lines of code commented above refer to the solutions I tried based on what was mentioned in various threads but didn't work for me.\r\n\r\nI am using Rails 4.2.1.\r\n\r\nAny help would be much appreciated!"},"comment":{"url":"https://api.github.com/repos/rgeo/activerecord-postgis-adapter/issues/comments/112672751","html_url":"https://github.com/rgeo/activerecord-postgis-adapter/issues/185#issuecomment-112672751","issue_url":"https://api.github.com/repos/rgeo/activerecord-postgis-adapter/issues/185","id":112672751,"user":{"login":"oyeanuj","id":9633371,"avatar_url":"https://avatars.githubusercontent.com/u/9633371?v=3","gravatar_id":"","url":"https://api.github.com/users/oyeanuj","html_url":"https://github.com/oyeanuj","followers_url":"https://api.github.com/users/oyeanuj/followers","following_url":"https://api.github.com/users/oyeanuj/following{/other_user}","gists_url":"https://api.github.com/users/oyeanuj/gists{/gist_id}","starred_url":"https://api.github.com/users/oyeanuj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oyeanuj/subscriptions","organizations_url":"https://api.github.com/users/oyeanuj/orgs","repos_url":"https://api.github.com/users/oyeanuj/repos","events_url":"https://api.github.com/users/oyeanuj/events{/privacy}","received_events_url":"https://api.github.com/users/oyeanuj/received_events","type":"User","site_admin":false},"created_at":"2015-06-17T06:33:47Z","updated_at":"2015-06-17T06:33:47Z","body":"I did manage to fix that by finally understanding that I was using older syntax with the latest version of the adapter. \r\n\r\nI do have another follow-up question incase anybody else has run into this - \r\n\r\n    irb(main):003:0> lala = Location.first\r\n    Location Load (1.6ms) SELECT \"locations\".* FROM \"locations\" ORDER BY \"locations\".\"id\" ASC LIMIT 1\r\n    (Object doesn't support #inspect) \r\n    irb(main):004:0> lala.class.name => \"Location\" \r\n    irb(main):005:0> puts lala\r\n    #<Location:0x007fdfd4bb2860>\r\n    => nil\r\n    irb(main):006:0> puts lala.inspect\r\n    NoMethodError: undefined method point' for nil:NilClass"}}