Hi, all! I’m new to fly.io when trying to deploy my app for the first time, I’ve been working through the errors and I am now stuck on this one:
fly deploy
==> Verifying app config
Validating /path/to/myproject/fly.toml
✓ Configuration is valid
--> Verified app config
==> Building image
Remote builder fly-builder-red-silence-2047 ready
Remote builder fly-builder-red-silence-2047 ready
==> Building image with Docker
--> docker host: 20.10.12 linux x86_64
[+] Building 4.0s (19/22)
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 32B 0.1s
=> [internal] load .dockerignore 0.1s
=> => transferring context: 35B 0.1s
=> resolve image config for docker.io/docker/dockerfile:1 0.3s
=> CACHED docker-image://docker.io/docker/dockerfile:1@sha256:ac85f380a63b13dfcefa89046420e1781752bab 0.0s
=> [internal] load build definition from Dockerfile 0.0s
=> [internal] load metadata for docker.io/library/ruby:3.2.2-slim 0.1s
=> [internal] load .dockerignore 0.0s
=> [internal] load build context 0.5s
=> => transferring context: 10.26kB 0.5s
=> [base 1/3] FROM docker.io/library/ruby:3.2.2-slim@sha256:b1b1636eb4e9d3499fc6166f54f7bb96d792e005b 0.0s
=> CACHED [base 2/3] WORKDIR /rails 0.0s
=> CACHED [base 3/3] RUN gem update --system --no-document && gem install -N bundler 0.0s
=> CACHED [stage-2 1/4] RUN apt-get update -qq && apt-get install --no-install-recommends -y curl 0.0s
=> CACHED [build 1/7] RUN apt-get update -qq && apt-get install --no-install-recommends -y build- 0.0s
=> CACHED [build 2/7] COPY Gemfile.lock ./ 0.0s
=> CACHED [build 3/7] COPY Gemfile ./ 0.0s
=> CACHED [build 4/7] RUN bundle install && bundle exec bootsnap precompile --gemfile && rm - 0.0s
=> [build 5/7] COPY --link . . 0.0s
=> [build 6/7] RUN bundle exec bootsnap precompile app/ lib/ 1.0s
=> ERROR [build 7/7] RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile 1.7s
------
> [build 7/7] RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile:
1.671 bin/rails aborted!
1.672 NameError: uninitialized constant Devise (NameError)
1.672
1.672 Devise.setup do |config|
1.672 ^^^^^^
1.672 /rails/config/initializers/devise.rb:12:in `<main>'
1.672 /rails/config/environment.rb:5:in `<main>'
1.673 Tasks: TOP => environment
1.673 (See full trace by running task with --trace)
------
Error: failed to fetch an image or build from source: error building: failed to solve: executor failed running [/bin/sh -c SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile]: exit code: 1
The app runs fine locally, it seems like the issue is in one of the bundling steps in the dockerfile, but I have worked through several solutions suggested here and elsewhere online.