我正在尝试使用宝石activerecord-postgis-adapter
当我尝试执行此代码时:
require 'active-record'
require 'pg'
require 'active record-postgis-adapter'
class Place < ActiveRecord::Base
record = Place.find(1)
line = record.location
puts line.srid
end
srid是一种方法activerecord-postgis-adapter
在这里我试图显示srid我的地理栏(位置),但控制台一直告诉我Failed to recognize type of 'location'. It will be treated as String.
.
可能找到了解决我的问题的方法,我用过PostgreSQL作为连接数据库时的适配器,我更改为postgis现在可以了。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)