こんにちは。Takitaです。
久しぶりにRailsをHerokuにデプロイにしてBASIC認証をかけたのでメモしておきます。
$ heroku login
$ heroku create app_name
$ git push heroku master
$ heroku addons:create cleardb:ignite
$ heroku config:set DATABASE_URL=mysql2://hogehuga?reconnect=true ` ( ` heroku config | grep CLEARDB_DATABASE_URL ` の mysql:// を mysql2:// に変更する)
$ heroku run rake db:migrate
$ heroku open
# application_controller.rb
+ http_basic_authenticate_with name: ENV['BASIC_AUTH_USERNAME'], password: ENV['BASIC_AUTH_PASSWORD'
$ heroku config:add BASIC_AUTH_USERNAME="hoge" BASIC_AUTH_PASSWORD="fuga"
https://devcenter.heroku.com/articles/getting-started-with-rails5
https://devcenter.heroku.com/articles/cleardb#provisioning-the-add-on
--
fix: タイトルを少し変更