Because Mysql of heloku and the database used for deployment were not linked.
heroku info
After execution, check the environment variables of the database
CLEARDB_DATABASE_URL: mysql://xxxxxxxxxxxx
CLEARDB_DATABASE_GREEN: mysql://xxxxxxxxxxxx
LANG: en_US.UTF-8
RACK_ENV: production
RAILS_ENV: production
RAILS_LOG_TO_STDOUT: enabled
RAILS_SERVE_STATIC_FILES: enabled
SECRET_KEY_BASE:
There should be DATABASE_URL: No, and I should have created a database with mysql2, but it is not reflected ...
This is in the terminal
heroku config:set DATABASE_URL=mysql2${heroku_cleardb:5}
Because there was no input and the environment variables could not be stored in the mysql2 database.
To change the environment variables, go to the heroku HP app page and click settings.
Click Reveal Config Vars in the center of the screen. Edit Config Vars and exit.
Safe,
heroku run rake db:migrate
it is complete!
Recommended Posts