Question: Hello I am new to rails.
I am working with an existing postgres db. I would like to create CRUD for all of the tables.
I've started with:
rails g scaffold firstTableName

Then I start rails:
rails s

When I navigate to localhost:3000/firstTableName, rails gives the following error:
Migrations are pending; run 'bin/rake db:migrate RAILS\_ENV=development' to resolve this issue.

I thought that 'rake db:migrate' was only for setting up your database. My db is already set up. If I run 'rake db:migrate', then I get an error that firstTableName already exists.
Please Help me understand how to make rails happy.
Thank you.

Answer: 
the error is because you already have the table firstTableName is already present and as you did scaffold, it will create the model, controller and view for you, so it has also create the migration for the firstTableName. 

If you already have the migration in place try skipping the migration while scaffolding

> 
> rails g scaffold firstTableName --skip-migration
> 
> 
>
Your database should have a table named `schema_migrations` with only one column `version`. Then you should write all migration versions into that table by hands.
Migrations placed in `project_root/db/migrate/`, and the вшпшеы in the file name is the same as version migration.