在schema.rb中未生成enable_extension“ plpgsql”

时间:2019-01-21 15:23:29

标签: ruby-on-rails database postgresql macos ruby-on-rails-4

我是红宝石的新手,我遇到了小错误,我相信您可以帮助我解决问题。

导轨无法在schema.rb中生成enable_extension "plpgsql"

我生成了这样的模型:

rails generate model CreateUsers last_name:string first_name:string birthday:date email:string password_digest:string

然后我运行rails db:migrate

我得到这个回报

...
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2019_01_21_134353) do

  create_table "create_users", force: :cascade do |t|
    t.string "last_name"
    t.string "first_name"
    t.date "birthdate"
    t.string "email"
    t.string "password_digest"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

end

  # These are extensions that must be enabled in order to support this database
  enable_extension "plpgsql"

我尝试删除表格并运行

rake db:rollback

rake db:migrate

仍未包含在schema.rb中

谢谢。

1 个答案:

答案 0 :(得分:0)

我不好!我想使用以下内容创建使用postgres的新应用

rails new gurudian-main-api --database=postgresql