Unable to introduce seed data into deployed rails app

bin/rails needs to be run from the ‘/rails’ directory. Specifying the full path doesn’t work.

Easiest thing to do is to split the command up:

flyctl ssh console
cd /rails
bin/rails db:seed

If this is something you expect to do frequently, you can adjust the files in your bin directory to set the current working directory using:

bin/rails generate dockerfile --bin-cd
fly deploy

This change will enable flyctl ssh console -C "/rails/bin/rails db:seed" to work as a single command.

The value of Rails.env.downcase will be production when deployed.