I’m attempting to deploy a Rails app to fly.io but am experiencing some unexpected behavior that I’m hoping to get help with.
For context, I teach a class where students learn how to write Ruby on Rails apps. We’re looking to have students work entirely with GitHub Codespaces.
The issue I’m having is that after running fly launch
, fly deploy
with always fail when bundling the assets
=> CACHED [build 5/6] RUN bundle exec bootsnap precompile app/ lib/ 0.0s
=> ERROR [build 6/6] RUN SECRET_KEY_BASE=DUMMY ./bin/rails assets:precompile 2.6s
------
> [build 6/6] RUN SECRET_KEY_BASE=DUMMY ./bin/rails assets:precompile:
#16 2.553 rails aborted!
#16 2.553 LoadError: libffi.so.7: cannot open shared object file: No such file or directory - /rails/vendor/bundle/ruby/2.7.0/gems/ffi-1.15.5/lib/ffi_c.so
I’ve tried adding install instructions for libffi7
in the Dockerfile
a few different ways. I’ve tried using the full Ruby 2.7.3 base image instead of the slim image but the error persists.
What I mainly don’t understand is that I can deploy app from my local WSL ubuntu environment without issue, but it fails when deployed from a codespace.
I thought that it shouldn’t matter what environment I deploy from if the image is being built remotely?
Could someone help me understand how I can make this project deploy successfully from a codespace?
Here is the repository I’ve been working from.