This is the first time im using fly and ruby on rails and i got an error while deploying my first app

1 desired, 1 placed, 0 healthy, 1 unhealthy [restarts: 2] [health checks: 1 total]
Failed Instances

Failure #1

Instance
ID PROCESS VERSION REGION DESIRED STATUS HEALTH CHECKS RESTARTS CREATED
add0b245 app 0 mad run failed 1 total 2 27s ago

Recent Events
TIMESTAMP TYPE MESSAGE
2023-01-31T18:45:13Z Received Task received by client
2023-01-31T18:45:13Z Task Setup Building Task Directory
2023-01-31T18:45:23Z Started Task started by client
2023-01-31T18:45:27Z Terminated Exit Code: 1
2023-01-31T18:45:27Z Restarting Task restarting in 1.063061578s
2023-01-31T18:45:33Z Started Task started by client
2023-01-31T18:45:37Z Terminated Exit Code: 1
2023-01-31T18:45:37Z Restarting Task restarting in 1.007930052s
2023-01-31T18:45:44Z Started Task started by client
2023-01-31T18:45:48Z Terminated Exit Code: 1
2023-01-31T18:45:48Z Not Restarting Exceeded allowed attempts 2 in interval 5m0s and mode is “fail”
2023-01-31T18:45:48Z Alloc Unhealthy Unhealthy because of failed task

2023-01-31T18:45:47Z [info] from /usr/local/lib/ruby/3.1.0/tsort.rb:205:in tsort_each' 2023-01-31T18:45:47Z [info] from /rails/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.2/lib/rails/initializable.rb:60:in run_initializers’
2023-01-31T18:45:47Z [info] from /rails/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.2/lib/rails/application.rb:372:in initialize!' 2023-01-31T18:45:47Z [info] from config.ru:3:in require_relative’
<main>' 2023-01-31T18:45:47Z [info] from config.ru:3:in require_relative’
2023-01-31T18:45:47Z [info] from config.ru:3:in block in <main>' 2023-01-31T18:45:47Z [info] from /rails/vendor/bundle/ruby/3.1.0/gems/rack-2.2.6.2/lib/rack/builder.rb:116:in eval’2023-01-31T18:45:47Z [info] from /rails/vendor/bundle/ruby/3.1.0/gems/rack-2.2.6.2/lib/rack/builder.rb:116:in new_from_string' 2023-01-31T18:45:47Z [info] from /rails/vendor/bundle/ruby/3.1.0/gems/rack-2.2.6.2/lib/rack/builder.rb:105:in load_file’
2023-01-31T18:45:47Z [info] from /rails/vendor/bundle/ruby/3.1.0/gems/rack-2.2.6.2/lib/rack/builder.rb:66:in parse_file' 2023-01-31T18:45:47Z [info] from /rails/vendor/bundle/ruby/3.1.0/gems/rack-2.2.6.2/lib/rack/server.rb:349:in build_app_and_options_from_config’
2023-01-31T18:45:47Z [info] from /rails/vendor/bundle/ruby/3.1.0/gems/rack-2.2.6.2/lib/rack/server.rb:249:in app' 2023-01-31T18:45:47Z [info] from /rails/vendor/bundle/ruby/3.1.0/gems/rack-2.2.6.2/lib/rack/server.rb:422:in wrapped_app’
2023-01-31T18:45:47Z [info] from /rails/vendor/bundle/ruby/3.1.0/gems/rack-2.2.6.2/lib/rack/server.rb:312:in block in start' 2023-01-31T18:45:47Z [info] from /rails/vendor/bundle/ruby/3.1.0/gems/rack-2.2.6.2/lib/rack/server.rb:379:in handle_profiling’
2023-01-31T18:45:47Z [info] from /rails/vendor/bundle/ruby/3.1.0/gems/rack-2.2.6.2/lib/rack/server.rb:311:in start'2023-01-31T18:45:47Z [info] from /rails/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.2/lib/rails/commands/server/server_command.rb:38:in start’
2023-01-31T18:45:47Z [info] from /rails/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.2/lib/rails/commands/server/server_command.rb:143:in block in perform' 2023-01-31T18:45:47Z [info] from <internal:kernel>:90:in tap’
2023-01-31T18:45:47Z [info] from /rails/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.2/lib/rails/commands/server/server_command.rb:134:in perform' 2023-01-31T18:45:47Z [info] from /rails/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor/command.rb:27:in run’
2023-01-31T18:45:47Z [info] from /rails/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in invoke_command' 2023-01-31T18:45:47Z [info] from /rails/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor.rb:392:in dispatch’
2023-01-31T18:45:47Z [info] from /rails/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.2/lib/rails/command.rb:48:in invoke' form' 2023-01-31T18:45:47Z [info] from /rails/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.2/lib/rails/command.rb:48:in invoke’
2023-01-31T18:45:47Z [info] from /rails/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.2/lib/rails/commands.rb:18:in <main>' 2023-01-31T18:45:47Z [info] from /rails/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require’
2023-01-31T18:45:47Z [info] from /rails/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require' 2023-01-31T18:45:47Z [info] from /rails/bin/rails:4:in
2023-01-31T18:45:47Z [info]Starting clean up.
→ v0 failed - Failed due to unhealthy allocations - no stable job version to auto revert to and deploying as v1

Error abort

It really is a shame that Rails stack tracebacks are so long. Unfortunately the message we want to see is before that point. If you type flyctl dashboard and then click on ‘Monitoring’ on the left hand column you can see more messages. If you scroll back to the point of the exception and paste a few lines starting from there it would be helpful.

From what I can see, it looks like you are dying in a Rails initializer, which generally means a source file in config/initializers. What often happens is that the code is looking for an environment variable which is not set, and failing.

I understood more actualy now but since im prety new to rails im kinda lost , is there any documentation that i can check for a solution:
Plus here is what i got in ‘Monitoring’

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/config/environment.rb:5:in `<main>'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.6/lib/zeitwerk/kernel.rb:38:in `require'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.2/lib/rails/application.rb:348:in `require_environment!'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.2/lib/rails/application.rb:511:in `block in run_tasks_blocks'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:243:in `block in invoke_prerequisites'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:241:in `each'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:241:in `invoke_prerequisites'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:218:in `block in invoke_with_call_chain'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:243:in `block in invoke_prerequisites'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:241:in `each'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:241:in `invoke_prerequisites'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:218:in `block in invoke_with_call_chain'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.2/lib/rails/commands/rake/rake_command.rb:24:in `block (2 levels) in perform'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.2/lib/rails/commands/rake/rake_command.rb:24:in `block in perform'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/rake_module.rb:59:in `with_application'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.2/lib/rails/commands/rake/rake_command.rb:18:in `perform'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.2/lib/rails/command.rb:51:in `invoke'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.2/lib/rails/commands.rb:18:in `<main>'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] Tasks: TOP => db:prepare => db:load_config => environment

2023-02-02T12:49:12.144 app[e7aeb57f] mad [info] (See full trace by running task with --trace)

2023-02-02T12:49:12.730 app[e7aeb57f] mad [info] => Booting Puma

2023-02-02T12:49:12.730 app[e7aeb57f] mad [info] => Rails 7.0.4.2 application starting in production

2023-02-02T12:49:12.730 app[e7aeb57f] mad [info] => Run `bin/rails server --help` for more startup options

2023-02-02T12:49:13.220 app[e7aeb57f] mad [info] W, [2023-02-02T12:49:12.996840 #520] WARN -- : You are running SQLite in production, this is generally not recommended. You can disable this warning by setting "config.active_record.sqlite3_production_warning=false".

2023-02-02T12:49:13.220 app[e7aeb57f] mad [info] Exiting

2023-02-02T12:49:13.220 app[e7aeb57f] mad [info] /rails/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.2/lib/rails/application.rb:581:in `validate_secret_key_base': Missing `secret_key_base` for 'production' environment, set this string with `bin/rails credentials:edit` (ArgumentError)

2023-02-02T12:49:13.220 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.2/lib/rails/application.rb:419:in `secret_key_base'

2023-02-02T12:49:13.220 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.2/lib/rails/application.rb:157:in `key_generator'

2023-02-02T12:49:13.220 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.2/lib/rails/application.rb:181:in `message_verifier'

2023-02-02T12:49:13.220 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/activestorage-7.0.4.2/lib/active_storage/engine.rb:137:in `block (2 levels) in <class:Engine>'

2023-02-02T12:49:13.220 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.4.2/lib/active_support/lazy_load_hooks.rb:92:in `block in execute_hook'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.4.2/lib/active_support/lazy_load_hooks.rb:85:in `with_execution_control'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.4.2/lib/active_support/lazy_load_hooks.rb:90:in `execute_hook'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.4.2/lib/active_support/lazy_load_hooks.rb:76:in `block in run_load_hooks'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.4.2/lib/active_support/lazy_load_hooks.rb:75:in `each'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.4.2/lib/active_support/lazy_load_hooks.rb:75:in `run_load_hooks'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.2/lib/rails/application/finisher.rb:87:in `block in <module:Finisher>'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.2/lib/rails/initializable.rb:32:in `instance_exec'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.2/lib/rails/initializable.rb:32:in `run'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.2/lib/rails/initializable.rb:61:in `block in run_initializers'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /usr/local/lib/ruby/3.1.0/tsort.rb:228:in `block in tsort_each'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /usr/local/lib/ruby/3.1.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /usr/local/lib/ruby/3.1.0/tsort.rb:431:in `each_strongly_connected_component_from'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /usr/local/lib/ruby/3.1.0/tsort.rb:349:in `block in each_strongly_connected_component'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /usr/local/lib/ruby/3.1.0/tsort.rb:347:in `each'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /usr/local/lib/ruby/3.1.0/tsort.rb:347:in `call'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /usr/local/lib/ruby/3.1.0/tsort.rb:347:in `each_strongly_connected_component'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /usr/local/lib/ruby/3.1.0/tsort.rb:226:in `tsort_each'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /usr/local/lib/ruby/3.1.0/tsort.rb:205:in `tsort_each'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.2/lib/rails/initializable.rb:60:in `run_initializers'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.2/lib/rails/application.rb:372:in `initialize!'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /rails/config/environment.rb:5:in `<main>'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from config.ru:3:in `block in <main>'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from config.ru:3:in `block in <main>'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/rack-2.2.6.2/lib/rack/builder.rb:116:in `eval'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/rack-2.2.6.2/lib/rack/builder.rb:116:in `new_from_string'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/rack-2.2.6.2/lib/rack/builder.rb:105:in `load_file'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/rack-2.2.6.2/lib/rack/builder.rb:66:in `parse_file'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/rack-2.2.6.2/lib/rack/server.rb:349:in `build_app_and_options_from_config'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/rack-2.2.6.2/lib/rack/server.rb:249:in `app'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/rack-2.2.6.2/lib/rack/server.rb:422:in `wrapped_app'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/rack-2.2.6.2/lib/rack/server.rb:312:in `block in start'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/rack-2.2.6.2/lib/rack/server.rb:379:in `handle_profiling'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/rack-2.2.6.2/lib/rack/server.rb:311:in `start'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.2/lib/rails/commands/server/server_command.rb:38:in `start'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.2/lib/rails/commands/server/server_command.rb:143:in `block in perform'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from <internal:kernel>:90:in `tap'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.2/lib/rails/commands/server/server_command.rb:134:in `perform'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.2/lib/rails/command/base.rb:87:in `perform'

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.2/lib/rails/commands.rb:18:in `<main>

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/railties-7.0.4.2/lib/rails/commands.rb:18:in `<main>

2023-02-02T12:49:13.221 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'

2023-02-02T12:49:13.222 app[e7aeb57f] mad [info] from /rails/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'

2023-02-02T12:49:13.222 app[e7aeb57f] mad [info] from /rails/bin/rails:4:in `<main>'

It looks like you may have gotten this application from somebody else? It is not uncommon to not check in the master key file as it is a secret.

You can generate your own master key using the command mentioned in the error: bin/rails credentials:edit. Once you do you can provide the key to fly with the following command:

fly secrets set RAILS_MASTER_KEY=$(cat config/master.key)

The above command works on MacOS, Linux, and WSL2. If you are using Microsoft PowerShell or CMD.exe, replace everything after the = sign with the contents of config\master.key.

i have got this while trying this rails credentials:edit

No $EDITOR to open file in. Assign one like this:

EDITOR="mate --wait" bin/rails credentials:edit

For editors that fork and exit immediately, it's important to pass a wait flag,
otherwise the credentials will be saved immediately with no chance to edit

Also since i have got the app from somebody else i didn’t find master.key file since it was in .gitignore when the project was cloned it didn’t clone the master.key file.
Is there a way to deploy the app without it ?

Is there a way to generate a new master key without geting this error

rails credentials:edit will do that. You need to set an EDITOR to use this command.

It woorked thank you so much @rubys ,
For anybody who got the same issue as me in deploying your app :
When a rails project is given to you or you get it from a github repository check if these two files exist config/master.key and config/credentials.yml.enc .

If you do not find master.key no worries the solution is simple:
1/Delete the config/credentials.yml.enc or save it somewhere for safety.
2/In your terminal use this command rails credentials:edit :
if the master.key and credentials.yml.enc are crated then perfect!! you will be able to deploy the app.

If you got an error like this

No $EDITOR to open file in. Assign one like this:

EDITOR="mate --wait" bin/rails credentials:edit``` ....

The solution is simple , as @rubys pointed an EDITOR is needed to be set so the command run well and here is how to do it:

Using visual studio code terminal type:

$env:EDITOR="mate--wait"

And then the rails credentials:edit will work perfectly and you will be able to deploy the app

This link from stackoverflow could be usefull if that did not work .

And hopefully your rails app will be deployed.