i’m trying to deploy my Rails API and ran into an issue:
[+] Building 1.7s (0/1)
[+] Building 6.7s (24/24) FINISHED
=> [internal] load remote build context 0.0s
=> copy /context / 0.1s
=> resolve image config for docker.io/docker/dockerfile:experimental 0.2s
=> CACHED docker-image://docker.io/docker/dockerfile:experimental@<removed>
=> [internal] load metadata for quay.io/evl.ms/fullstaq-ruby:3.1.2-jemalloc-slim 0.1s
=> [base 1/6] FROM quay.io/evl.ms/fullstaq-ruby:3.1.2-jemalloc-slim@<removed> 0.0s
=> CACHED [base 2/6] RUN mkdir /app 0.0s
=> CACHED [base 3/6] WORKDIR /app 0.0s
=> CACHED [base 4/6] RUN mkdir -p tmp/pids 0.0s
=> CACHED [base 5/6] RUN curl https://get.volta.sh | bash 0.0s
=> CACHED [base 6/6] RUN volta install node@16.14.2 && volta install yarn 0.0s
=> CACHED [stage-4 1/6] RUN --mount=type=cache,id=prod-apt-cache,sharing=locked,target=/var/cache/apt 0.0s
=> CACHED [build_deps 1/1] RUN --mount=type=cache,id=dev-apt-cache,sharing=locked,target=/var/cache/apt 0.0s
=> CACHED [gems 1/3] RUN gem install -N bundler -v 2.3.22 0.0s
=> CACHED [gems 2/3] COPY Gemfile* ./ 0.0s
=> CACHED [gems 3/3] RUN bundle install && rm -rf vendor/bundle/ruby/*/cache 0.0s
=> CACHED [stage-4 2/6] COPY --from=gems /app /app 0.0s
=> CACHED [node_modules 1/3] COPY package*json ./ 0.0s
=> CACHED [node_modules 2/3] COPY yarn.* ./ 0.0s
=> CACHED [node_modules 3/3] RUN if [ -f "yarn.lock" ]; then yarn install; elif [ -f "package-lo 0.0s
=> CACHED [stage-4 3/6] COPY --from=node_modules /app/node_modules /app/node_modules 0.0s
=> [stage-4 4/6] COPY . . 0.1s
=> [stage-4 5/6] RUN chmod +x /app/bin/* && sed -i 's/ruby.exe/ruby/' /app/bin/* && sed -i '/^#! 0.3s
=> ERROR [stage-4 6/6] RUN bin/rails fly:build 5.6s
------
> [stage-4 6/6] RUN bin/rails fly:build:
#24 5.504 rails aborted!
#24 5.504 Don't know how to build task 'assets:precompile' (See the list of available tasks with `rails --tasks`)
#24 5.504 /app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task_manager.rb:59:in `[]'
#24 5.504 /app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:66:in `lookup_prerequisite'
#24 5.504 /app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:62:in `block in prerequisite_tasks'
#24 5.504 /app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:62:in `map'
#24 5.504 /app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:62:in `prerequisite_tasks'
#24 5.504 /app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:241:in `invoke_prerequisites'
#24 5.504 /app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:218:in `block in invoke_with_call_chain'
#24 5.504 /app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
#24 5.504 /app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
#24 5.504 /app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
#24 5.504 /app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
#24 5.504 /app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
#24 5.504 /app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
#24 5.504 /app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
#24 5.504 /app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
#24 5.504 /app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
#24 5.504 /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.3.1/lib/rails/commands/rake/rake_command.rb:24:in `block (2 levels) in perform'
#24 5.504 /app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
#24 5.504 /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.3.1/lib/rails/commands/rake/rake_command.rb:24:in `block in perform'
#24 5.504 /app/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/rake_module.rb:59:in `with_application'
#24 5.504 /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.3.1/lib/rails/commands/rake/rake_command.rb:18:in `perform'
#24 5.504 /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.3.1/lib/rails/command.rb:51:in `invoke'
#24 5.504 /app/vendor/bundle/ruby/3.1.0/gems/railties-7.0.3.1/lib/rails/commands.rb:18:in `<main>'
#24 5.504 /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
#24 5.504 /app/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
#24 5.505 Tasks: TOP => fly:build
#24 5.505 (See full trace by running task with --trace)
so, i don’t think my API has assets like a normal rails app, so is it ok to comment out the build action in the fly.io rake file?
# commands used to deploy a Rails application
namespace :fly do
# BUILD step:
# - changes to the filesystem made here DO get deployed
# - NO access to secrets, volumes, databases
# - Failures here prevent deployment
task :build => 'assets:precompile'
# RELEASE step:
# - changes to the filesystem made here are DISCARDED
# - full access to secrets, databases
# - failures here prevent deployment
task :release => 'db:migrate'
# SERVER step:
# - changes to the filesystem made here are deployed
# - full access to secrets, databases
# - failures here result in VM being stated, shutdown, and rolled back
# to last successful deploy (if any).
task :server do
sh 'bin/rails server'
end
end