【发布时间】:2015-02-27 09:34:36
【问题描述】:
我在我的项目中使用了 rails 4 和 postgresql 9.4。当我运行 "rdd && rdc && rdm && rds" 时,我得到了这个错误 PG::UndefinedObject: ERROR: type "jsonb" does not exist 如何解决这个错误?告诉我。
我的迁移文件:
class CreateConsultingLocationDoctorSchedules < ActiveRecord::Migration
def change
create_table :consulting_location_doctor_schedules do |t|
t.belongs_to :consulting_location_doctor
t.datetime :schedule_date, null: false
t.jsonb :slot_details, index: true, default: {}
t.daterange :start_and_end_time, null: false
t.datetime :deleted_at
t.belongs_to :deleted_by
t.timestamps
end
end
end
感谢您的帮助!
【问题讨论】:
-
这表明您的 Rails 版本实际上不是 4.2,因为至少您的格式是正确的,并且必要的版本是 Rails 的 4.2 和 PostgreSQL 的 9.4。你能仔细检查一下吗?
-
我有同样的问题,我正在使用 rails 4.2 和 pg 9.4.1 你找到任何解决方案了吗??
-
重复的问题和解决方法在这里:stackoverflow.com/questions/29393562/…
标签: postgresql ruby-on-rails-4 jsonb