1
我正在使用以下gem,georuby,spatial_adapter運行rails 2項目。 Postgres數據庫作爲後端。但是我正面臨着這個錯誤。我厭倦了安裝postgis,但仍然得到這個。任何想法我應該嘗試。這是一個rails 2.3項目,所以我缺少一些版本要求。聲明似乎是正確的,我也將它綁起來。請幫忙。在Rails 2項目上運行Rake命令時出現錯誤
[[email protected] 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)
感謝
我覺得你的問題在於你的PostgreSQL/PostGis的安裝,而不是rails/ruby相關。 – shingara 2012-02-17 09:40:03
是我也覺得,但是你能否確認語法是否正確。還建議我可能需要哪個版本的postgres和/或postgis。我目前在fedora盒子上使用gr 8.4和postgis 1.5.3。 – 2012-02-17 10:21:29
我還沒有鏈接postgres和postgres。因此面臨這個問題。 請按照postgis站點上的步驟將第一個和第一個創建數據庫鏈接起來。 – 2012-02-17 13:02:02