This custom table comes with the PostGIS extension. It has been added automatically. Your schema.rb probably contains the line: create_table "spatial_ref_sys", primary_key: "srid", id: :integer, force: :cascade do |t|
Then you try to recreate your database with rake db:reset or create a test database with rake . Since the force parameter is set, it first discards the existing table, but postgis is required.
A quick solution is to ignore this table in some initializer:
::ActiveRecord::SchemaDumper.ignore_tables |= %w(spatial_ref_sys)
Then run rake db:migrate to update the schema.rb file and do this.
But, most likely, you will want to work with some PostGIS functions using gem activerecord-postgis-adapter . It will also fix schema.rb for you.
source share