I have used rails 4 and postgresql 9.4 in my project.when i was run "rdd && rdc && rdm && rds" and i got this error PG::UndefinedObject: ERROR: type "jsonb" does not exist how do solve this error? tell me.
My migrate file:
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
Thanks for ur help!
Check that you are connected to the right Postgres instance in development.
rails console
ActiveRecord::Base.connection.execute("select version();").first["version"]
If you're sure you are running 9.4, then it might be that you have two Postgres servers running. One 9.4, and an older one.
I ran into this problem and edited my database.yml and specified host: 'localhost'
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With