在 Rails 2 项目上运行 rake 命令时出现错误
我正在运行一个 Rails 2 项目,其中包含以下 gem、georuby、spatial_adapter。和 Postgres 数据库作为后端。但我面临这个错误。我也厌倦了安装 postgis,但仍然得到这个。我应该尝试什么想法。这是一个 Rails 2.3 项目,所以我缺少一些版本要求吗?这个说法似乎是正确的,我也查了一下。请帮忙。
[root@localhost webapp]# rake db:migrate
(in /root/mysite/webapp)
== CreatePlaces: migrating ===================================================
-- create_table(:places, {:id=>false})
-> 0.0030s
-- execute("alter table places add primary key (id)")
NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index "places_pkey" for table "places"
-> 0.1144s
-- execute("select AddGeometryColumn('public', 'places', 'point_geometry', 4326, 'POINT', 3)")
rake aborted!
An error has occurred, this and all later migrations canceled:
PGError: ERROR: function addgeometrycolumn(unknown, unknown, unknown, integer, unknown, integer) does not exist
LINE 1: select AddGeometryColumn('public', 'places', 'point_geometry...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
: select AddGeometryColumn('public', 'places', 'point_geometry', 4326, 'POINT', 3)
谢谢
I am runnning a rails 2 project with the following gems, georuby, spatial_adapter. And Postgres db as backend. But I am facing this error. I tired installing postgis also but still get this. Any ideas what i should try. This is a rails 2.3 project ,so is it some version requirements i am missing. The statement seems to be correct and i tied looking it up too. Please help.
[root@localhost webapp]# rake db:migrate
(in /root/mysite/webapp)
== CreatePlaces: migrating ===================================================
-- create_table(:places, {:id=>false})
-> 0.0030s
-- execute("alter table places add primary key (id)")
NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index "places_pkey" for table "places"
-> 0.1144s
-- execute("select AddGeometryColumn('public', 'places', 'point_geometry', 4326, 'POINT', 3)")
rake aborted!
An error has occurred, this and all later migrations canceled:
PGError: ERROR: function addgeometrycolumn(unknown, unknown, unknown, integer, unknown, integer) does not exist
LINE 1: select AddGeometryColumn('public', 'places', 'point_geometry...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
: select AddGeometryColumn('public', 'places', 'point_geometry', 4326, 'POINT', 3)
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我没有将 post gis 与 postgres 链接起来。因此面临这个问题。
请按照以下步骤操作并首先创建您的数据库。
创建 PostGIS 数据库的第一步是创建一个简单的 PostgreSQL 数据库。
I had not linked post gis with postgres. Thus was facing this issue.
Follow the steps below and create your db first.
The first step in creating a PostGIS database is to create a simple PostgreSQL database.