I’m getting this error on the “Building image with Docker” step. I’m also getting this error as the final output:
failed to fetch an image or build from source: error building: failed to solve: process "/bin/sh -c bundle install && bundle exec bootsnap precompile --gemfile && rm -rf ~/.bundle/ $BUNDLE_PATH/ruby/*/cache $BUNDLE_PATH/ruby/*/bundler/gems/*/.git" did not complete successfully: exit code: 18
Fly.io is able to deploy Rails 7.2 apps. There likely is something in your Gemfile that has a dependency that is not being met. Can you check your logs for more information and/or post your Gemfile?
Here is my Gemfile. I just did an update from Rails 7.0 to 7.1 and it deployed fine. Now I’m doing an update from 7.1 to 7.2 and I’m getting that error.
2024-08-11T23:29:46Z proxy[e784e693a477d8] sjc [info]App esbc-employees has excess capacity, autostopping machine e784e693a477d8. 0 out of 1 machines left running (region=sjc, process group=app)
2024-08-11T23:29:46Z app[e784e693a477d8] sjc [info] INFO Sending signal SIGINT to main child process w/ PID 314
2024-08-11T23:29:46Z app[e784e693a477d8] sjc [info]- Gracefully stopping, waiting for requests to finish
2024-08-11T23:29:46Z app[e784e693a477d8] sjc [info]=== puma shutdown: 2024-08-11 23:29:46 +0000 ===
2024-08-11T23:29:46Z app[e784e693a477d8] sjc [info]- Goodbye!
2024-08-11T23:29:46Z app[e784e693a477d8] sjc [info]Exiting
2024-08-11T23:29:46Z app[e784e693a477d8] sjc [info] INFO Main child exited normally with code: 0
2024-08-11T23:29:46Z app[e784e693a477d8] sjc [info] INFO Starting clean up.
2024-08-11T23:29:46Z app[e784e693a477d8] sjc [info] WARN could not unmount /rootfs: EINVAL: Invalid argument
2024-08-11T23:29:46Z app[e784e693a477d8] sjc [info][ 439.248610] reboot: Restarting system
Are here is a chunk from the logs that is repeated over and over:
2024-08-11T23:24:03Z app[148ee7ea351189] sjc [info] WARN could not unmount /rootfs: EINVAL: Invalid argument
2024-08-11T23:24:03Z app[148ee7ea351189] sjc [info][ 2.534494] reboot: Restarting system
2024-08-11T23:24:03Z runner[148ee7ea351189] sjc [info]machine did not have a restart policy, defaulting to restart
2024-08-11T23:24:07Z app[148ee7ea351189] sjc [info]2024-08-11T23:24:07.302123187 [01J4M8F6YCG4JWHMHD10YFDH58:main] Running Firecracker v1.7.0
2024-08-11T23:24:07Z app[148ee7ea351189] sjc [info][ 0.285600] PCI: Fatal: No config space access function found
2024-08-11T23:24:07Z app[148ee7ea351189] sjc [info] INFO Starting init (commit: 3dd5d9e)...
2024-08-11T23:24:07Z app[148ee7ea351189] sjc [info] INFO starting statics vsock server
2024-08-11T23:24:07Z app[148ee7ea351189] sjc [info] INFO Preparing to run: `/rails/bin/docker-entrypoint ./bin/rails server` as rails
2024-08-11T23:24:07Z app[148ee7ea351189] sjc [info] INFO [fly api proxy] listening at /.fly/api
2024-08-11T23:24:07Z app[148ee7ea351189] sjc [info]2024/08/11 23:24:07 INFO SSH listening listen_address=[fdaa:2:d6ef:a7b:138:77cc:3d33:2]:22 dns_server=[fdaa::3]:53
2024-08-11T23:24:07Z runner[148ee7ea351189] sjc [info]Machine started in 765ms
2024-08-11T23:24:09Z app[148ee7ea351189] sjc [info]=> Booting Puma
2024-08-11T23:24:09Z app[148ee7ea351189] sjc [info]=> Rails 7.0.7 application starting in production
2024-08-11T23:24:09Z app[148ee7ea351189] sjc [info]=> Run `bin/rails server --help` for more startup options
2024-08-11T23:24:09Z app[148ee7ea351189] sjc [info]A server is already running. Check /rails/tmp/pids/server.pid.
2024-08-11T23:24:09Z app[148ee7ea351189] sjc [info]Exiting
2024-08-11T23:24:09Z app[148ee7ea351189] sjc [info] INFO Main child exited normally with code: 1
2024-08-11T23:24:09Z app[148ee7ea351189] sjc [info] INFO Starting clean up.
There is a bug in Ruby 3.3.3 which will prevent a successful deploy. Can you upgrade to 3.3.4 or downgrade to 3.3.2?
Alternately, you can run bin/rails generate dockerfile to generate a new Dockerfile with a workaround, or you can manually apply the workaround yourself: