I am attempting to start a Rails 5.1 app from scratch using ROM. I have defined a
users relation, but no corresponding migration (yet). When I try to run
rails db:create_migration[create_users] task, I get:
[Users] failed to infer schema. Make sure tables exist before ROM container is set up. This may also happen when your migration tasks load ROM container, which is not needed for migrations as only the connection is required (PG::UndefinedTable: ERROR: relation "users" does not exist LINE 1: ..."."attnum" > 0) AND ("pg_class"."oid" = CAST(CAST('"users"' ... ^ ) /app/db/schema.rb doesn't exist yet. Run `rails db:migrate` to create it, then try again. If you do not intend to use a database, you should instead alter /app/config/application.rb to limit the frameworks that will be loaded.
But, I can’t seem to figure out how to get that file created, as any rake task I run gives this error. I am sure I am just being dense, so if anyone could nudge me along on getting a simple relation, schema, migration in “the right way”, I’d appreciate it.