状況
任意のホスト名を指定してアクセスしようとした際に次のようなエラーが発生しました。
Blocked host: sample-host.com
To allow requests to sample-host.com, add the following to your environment configuration:
config.hosts << "sample-host.com"
解消法
次のようにconfig/environments/development.rb
に追加しホストを許可することで解消します。
development.rb
Rails.application.configure do
config.hosts << "sample-host.com"
end