2014-03-29 115 views
0

我已经安装了网站在新服务器上,并安装PostgreSQL的。现在我试图耙数据库。并得到以下错误:错误试图运行耙分贝:迁移PostgreSQL的

我有这个在CentOS 6.5红宝石1.93和Ruby on Rails 3

[[email protected] current]# rake db:migrate 
rake aborted! 
PG::Error: ERROR: relation "geometry_columns" does not exist 
LINE 1: SELECT * FROM geometry_columns WHERE f_table_name='schema_mi... 
        ^
: SELECT * FROM geometry_columns WHERE f_table_name='schema_migrations' 

Tasks: TOP => db:migrate 
(See full trace by running task with --trace) 

上传整个文件夹DB我的网站之一...您可以在这里查看http://www.digihaul.com/stackoverflow

这里是对不起

# encoding: UTF-8 
# This file is auto-generated from the current state of the database. Instead 
# of editing this file, please use the migrations feature of Active Record to 
# incrementally modify your database, and then regenerate this schema definition. 
# 
# Note that this schema.rb definition is the authoritative source for your 
# database schema. If you need to create the application database on another 
# system, you should be using db:schema:load, not running all the migrations 
# from scratch. The latter is a flawed and unsustainable approach (the more migrations 
# you'll amass, the slower it'll run and the greater likelihood for issues). 
# 
# It's strongly recommended to check this file into your version control system. 

ActiveRecord::Schema.define(:version => 20130811174830) do 

    create_table "archived_loads", :id => false, :force => true do |t| 
    t.integer "id" 
    t.integer "user_id" 
    t.spatial "origin",  :limit => {:srid=>4326, :type=>"point", :geographic=>true} 
    t.spatial "dest",   :limit => {:srid=>4326, :type=>"point", :geographic=>true} 
    t.integer "length" 
    t.string "comments" 
    t.boolean "ltl" 
    t.decimal "rate" 
    t.datetime "delivery" 
    t.datetime "pickup" 
    t.integer "weight" 
    t.integer "equipment_id" 
    t.boolean "covered" 
    t.datetime "created_at" 
    t.datetime "updated_at" 
    t.integer "owner" 
    t.boolean "deleted" 
    t.string "origin_city" 
    t.string "origin_state" 
    t.string "dest_city" 
    t.string "dest_state" 
    end 

    create_table "archived_trucks", :id => false, :force => true do |t| 
    t.integer "id" 
    t.integer "user_id" 
    t.spatial "origin",  :limit => {:srid=>4326, :type=>"point", :geographic=>true} 
    t.spatial "dest",   :limit => {:srid=>4326, :type=>"point", :geographic=>true} 
    t.boolean "covered" 
    t.datetime "available" 
    t.datetime "expiration" 
    t.integer "equipment_id" 
    t.string "comments" 
    t.datetime "created_at" 
    t.datetime "updated_at" 
    t.integer "owner" 
    t.boolean "deleted" 
    t.string "origin_city" 
    t.string "origin_state" 
    t.string "dest_city" 
    t.string "dest_state" 
    end 

    create_table "autopost_headers", :force => true do |t| 
    t.integer "company_id" 
    t.string "pickup" 
    t.string "delivery" 
    t.string "dest" 
    t.string "origin" 
    t.string "available" 
    t.string "expiration" 
    t.string "rate" 
    t.string "length" 
    t.string "equipment" 
    t.string "weight" 
    t.datetime "created_at", :null => false 
    t.datetime "updated_at", :null => false 
    end 

    create_table "companies", :force => true do |t| 
    t.string "name" 
    t.string "city" 
    t.string "state" 
    t.string "zip" 
    t.string "address" 
    t.boolean "status" 
    t.integer "mc" 
    t.string "dispatch" 
    t.string "fax" 
    t.datetime "created_at", :null => false 
    t.datetime "updated_at", :null => false 
    t.string "credit_score" 
    end 

    create_table "credit_scores", :force => true do |t| 
    t.string "mc" 
    t.string "fbc" 
    t.string "dbt" 
    t.string "xp" 
    t.datetime "created_at", :null => false 
    t.datetime "updated_at", :null => false 
    end 

    create_table "documents", :force => true do |t| 
    t.integer "user_id" 
    t.string "name" 
    t.string "description" 
    t.string "filename" 
    t.string "filetype" 
    t.integer "filesize" 
    t.datetime "created_at", :null => false 
    t.datetime "updated_at", :null => false 
    end 

    create_table "equipment", :force => true do |t| 
    t.string "code" 
    t.string "name" 
    t.string "description" 
    t.string "altcode" 
    t.boolean "special_type" 
    t.datetime "created_at", :null => false 
    t.datetime "updated_at", :null => false 
    t.integer "parent_id" 
    end 

    create_table "equipment_notifications", :id => false, :force => true do |t| 
    t.integer "equipment_id", :null => false 
    t.integer "notification_id", :null => false 
    end 

    add_index "equipment_notifications", ["equipment_id", "notification_id"], :name => "index_eq_not_on_equipment_id_and_notification_id", :unique => true 
    add_index "equipment_notifications", ["notification_id", "equipment_id"], :name => "index_eq_not_on_notification_id_and_equipment_id", :unique => true 

    create_table "equipment_searches", :id => false, :force => true do |t| 
    t.integer "equipment_id", :null => false 
    t.integer "search_id", :null => false 
    end 

    add_index "equipment_searches", ["equipment_id", "search_id"], :name => "index_equipment_searches_on_equipment_id_and_search_id", :unique => true 
    add_index "equipment_searches", ["search_id", "equipment_id"], :name => "index_equipment_searches_on_search_id_and_equipment_id", :unique => true 

    create_table "lane_analyses", :force => true do |t| 
    t.spatial "origin",  :limit => {:srid=>4326, :type=>"point", :geographic=>true} 
    t.spatial "dest",   :limit => {:srid=>4326, :type=>"point", :geographic=>true} 
    t.integer "company_id" 
    t.integer "equipment_id" 
    t.integer "length" 
    t.boolean "ltl" 
    t.datetime "created_at",                :null => false 
    t.datetime "updated_at",                :null => false 
    end 

    add_index "lane_analyses", ["company_id"], :name => "index_lane_analyses_on_company_id" 
    add_index "lane_analyses", ["dest"], :name => "index_lane_analyses_on_dest", :spatial => true 
    add_index "lane_analyses", ["equipment_id"], :name => "index_lane_analyses_on_equipment_id" 
    add_index "lane_analyses", ["origin"], :name => "index_lane_analyses_on_origin", :spatial => true 

    create_table "leads", :force => true do |t| 
    t.integer "user_id" 
    t.integer "type_id" 
    t.string "post_type" 
    t.datetime "created_at", :null => false 
    t.datetime "updated_at", :null => false 
    end 

    add_index "leads", ["type_id"], :name => "index_leads_on_type_id" 
    add_index "leads", ["user_id"], :name => "index_leads_on_user_id" 

    create_table "loads", :force => true do |t| 
    t.integer "user_id" 
    t.spatial "origin",  :limit => {:srid=>4326, :type=>"point", :geographic=>true} 
    t.spatial "dest",   :limit => {:srid=>4326, :type=>"point", :geographic=>true} 
    t.integer "length" 
    t.string "comments" 
    t.boolean "ltl" 
    t.decimal "rate" 
    t.datetime "delivery" 
    t.datetime "pickup" 
    t.integer "weight" 
    t.integer "equipment_id" 
    t.boolean "covered",                 :default => false, :null => false 
    t.datetime "created_at",                     :null => false 
    t.datetime "updated_at",                     :null => false 
    t.integer "owner" 
    t.boolean "deleted",                 :default => false 
    t.string "origin_city" 
    t.string "origin_state" 
    t.string "dest_city" 
    t.string "dest_state" 
    end 

    add_index "loads", ["dest"], :name => "index_loads_on_dest", :spatial => true 
    add_index "loads", ["equipment_id"], :name => "index_loads_on_equipment_id" 

    create_table "locations", :force => true do |t| 
    t.spatial "coords",  :limit => {:srid=>4326, :type=>"point", :geographic=>true} 
    t.string "city" 
    t.string "state" 
    t.string "zip" 
    t.datetime "created_at",                :null => false 
    t.datetime "updated_at",                :null => false 
    t.string "cs" 
    end 

    create_table "messages", :force => true do |t| 
    t.integer "user_id" 
    t.string "message" 
    t.integer "notifier_id" 
    t.boolean "received", :default => false 
    t.datetime "expiration" 
    t.datetime "created_at",      :null => false 
    t.datetime "updated_at",      :null => false 
    end 

    create_table "notifications", :force => true do |t| 
    t.integer "user_id" 
    t.spatial "origin",   :limit => {:srid=>4326, :type=>"point", :geographic=>true} 
    t.spatial "dest",    :limit => {:srid=>4326, :type=>"point", :geographic=>true} 
    t.integer "length" 
    t.boolean "ltl" 
    t.integer "rate" 
    t.datetime "delivery" 
    t.datetime "pickup" 
    t.integer "weight" 
    t.datetime "available" 
    t.datetime "expiration" 
    t.datetime "created_at",                 :null => false 
    t.datetime "updated_at",                 :null => false 
    t.integer "radius" 
    t.string "notification_type" 
    end 

    create_table "reports", :force => true do |t| 
    t.string "name" 
    t.string "metric" 
    t.integer "value" 
    t.datetime "created_at", :null => false 
    t.datetime "updated_at", :null => false 
    end 

    create_table "searches", :force => true do |t| 
    t.datetime "available" 
    t.datetime "pickup" 
    t.datetime "delivery" 
    t.decimal "rate" 
    t.integer "length" 
    t.integer "user_id" 
    t.integer "weight" 
    t.string "search_type" 
    t.boolean "ltl" 
    t.datetime "created_at",       :null => false 
    t.datetime "updated_at",       :null => false 
    t.datetime "expiration" 
    t.string "pickup_operator",  :default => ">=" 
    t.string "delivery_operator", :default => "<=" 
    t.string "expiration_operator", :default => "<=" 
    t.string "available_operator", :default => ">=" 
    t.string "length_operator",  :default => "<=" 
    t.string "rate_operator",  :default => "<=" 
    t.string "weight_operator",  :default => "<=" 
    t.string "origin_zip" 
    t.string "dest_zip" 
    t.integer "origin_radius" 
    t.integer "dest_radius" 
    t.boolean "saved" 
    t.date  "date_posted" 
    t.string "order_by" 
    t.integer "origin_id" 
    t.integer "dest_id" 
    t.integer "results",    :default => 0 
    t.string "origin_states" 
    t.string "dest_states" 
    end 

    add_index "searches", ["dest_id"], :name => "index_searches_on_dest" 
    add_index "searches", ["origin_id"], :name => "index_searches_on_origin" 

    create_table "subscriptions", :force => true do |t| 
    t.integer "company_id" 
    t.decimal "price" 
    t.integer "tier_id" 
    t.string "recurrence" 
    t.datetime "created_at",  :null => false 
    t.datetime "updated_at",  :null => false 
    t.string "paysysid" 
    t.integer "billing_date" 
    t.datetime "last_payment_date" 
    end 

    create_table "testimonials", :force => true do |t| 
    t.string "customer" 
    t.text  "description" 
    t.datetime "created_at",      :null => false 
    t.datetime "updated_at",      :null => false 
    t.boolean "approved", :default => false 
    end 

    create_table "tiers", :force => true do |t| 
    t.string "name" 
    t.string "desc" 
    t.datetime "created_at", :null => false 
    t.datetime "updated_at", :null => false 
    end 

    create_table "trucks", :force => true do |t| 
    t.integer "user_id" 
    t.spatial "origin",  :limit => {:srid=>4326, :type=>"point", :geographic=>true} 
    t.spatial "dest",   :limit => {:srid=>4326, :type=>"point", :geographic=>true} 
    t.boolean "covered",                 :default => false, :null => false 
    t.datetime "available" 
    t.datetime "expiration" 
    t.integer "equipment_id" 
    t.string "comments" 
    t.datetime "created_at",                     :null => false 
    t.datetime "updated_at",                     :null => false 
    t.integer "owner" 
    t.boolean "deleted",                 :default => false 
    t.string "origin_city" 
    t.string "origin_state" 
    t.string "dest_city" 
    t.string "dest_state" 
    end 

    create_table "user_preferences", :force => true do |t| 
    t.integer "user_id" 
    t.integer "radius",     :default => 175 
    t.integer "page_size",    :default => 10 
    t.text  "view",     :default => "table" 
    t.boolean "can_be_email_notified", :default => false 
    t.boolean "can_be_sms_notified", :default => false 
    t.integer "max_sms",    :default => 0 
    t.integer "max_email",    :default => 0 
    t.integer "emailed_today",   :default => 0 
    t.integer "smsd_today",    :default => 0 
    t.boolean "can_be_screen_notified", :default => false 
    t.datetime "created_at",         :null => false 
    t.datetime "updated_at",         :null => false 
    t.text  "provider",    :default => "" 
    t.string "default_sound" 
    end 

    create_table "users", :force => true do |t| 
    t.integer "company_id" 
    t.string "username" 
    t.string "password" 
    t.string "email" 
    t.string "dispatch" 
    t.string "fax" 
    t.string "sms" 
    t.boolean "status" 
    t.boolean "company_manager" 
    t.datetime "created_at",        :null => false 
    t.datetime "updated_at",        :null => false 
    t.string "encrypted_password",  :default => "", :null => false 
    t.string "reset_password_token" 
    t.datetime "reset_password_sent_at" 
    t.datetime "remember_created_at" 
    t.integer "sign_in_count",   :default => 0 
    t.datetime "current_sign_in_at" 
    t.datetime "last_sign_in_at" 
    t.string "current_sign_in_ip" 
    t.string "last_sign_in_ip" 
    end 

end 

这里正确的文件是胜负

postgres=# DROP EXTENSION postgis; 
ERROR: extension "postgis" does not exist 
postgres=# CREATE EXTENSION postgis; 
ERROR: type "spheroid" already exists 
postgres=# DROP EXTENSION postgis; 
ERROR: extension "postgis" does not exist 
postgres=# CREATE SCHEMA postgis; 
ERROR: schema "postgis" already exists 
postgres=# CREATE EXTENSION postgis WITH SCHEMA postgis; 
ERROR: could not load library "/usr/pgsql-9.3/lib/rtpostgis-2.1.so": libhdf5.so.6: cannot open shared object file: No such file or directory 

我曾经找-name查找文件:

[[email protected] /]# find -name rtpostgis-2.1.so 
./usr/pgsql-9.3/lib/rtpostgis-2.1.so 

[[email protected] /]# find -name libhdf5.so.6 
./usr/lib64/mpich2/lib/libhdf5.so.6 
./usr/pgsql-9.3/lib/libhdf5.so.6 
./usr/lib/mpich2/lib/libhdf5.so.6 

只表明未找到或空白 如你所见的依赖是有两倍的人。

[[email protected] /]# ldd /usr/pgsql-9.3/lib/rtpostgis-2.1.so 
     linux-vdso.so.1 => (0x00007fffcd9ff000) 
     libhdf5.so.6 => not found 
     libhdf5_hl.so.6 => not found 
     libhdf5.so.6 => not found 
+0

检查迁移文件的错误。将它添加到您的问题plz – kirqe

+0

问题是您尚未创建该表格,或者您在迁移文件中输入了错字。 – kirqe

+0

上传整个文件夹DB我的网站之一...你可以在这里http://digihaul.com/stackoverflow/查看 –

回答

1

PG::Error: ERROR: relation "geometry_columns" does not exist LINE 1: SELECT * FROM geometry_columns WHERE f_table_name='schema_mi... ^: SELECT * FROM geometry_columns WHERE f_table_name='schema_migrations'

按照错误,geometry_columns表不存在于数据库中。
好像问题与安装,可能与CREATE EXTENSION postgis;查询,你需要至少运行一次。

请参考PostGIS这里的指示。

编辑

尝试以下步骤:

DROP EXTENSION postgis; 
CREATE SCHEMA postgis; 
CREATE EXTENSION postgis WITH SCHEMA postgis; 
+0

我已经跑了那个命令。该扩展已创建。这整个网站在另一台服务器上工作。但我试图做一个重复的本地服务器,这样我就可以发展离不开生产服务器下去 –

+0

@BigAlRubyNewbie检查我的更新答案 –

+0

我加入了结果我的帖子 –