This is my first Rails app and my first time using Fly. I have been attempting to follow the Rails starting guide, and upon trying to deploy, the build fails on the fourth step:
ERROR [build 4/10] RUN bundle install && bundle exec bootsnap precompile --gemfile && rm -rf ~/. 81.4s ------ > [build 4/10] RUN bundle install && bundle exec bootsnap precompile --gemfile && rm -rf ~/.bundle/ $BUNDLE_PATH/ruby/*/cache $BUNDLE_PATH/ruby/*/bundler/gems/*/.git: #0 0.652 Bundler 2.4.21 is running, but your lockfile was generated with 2.3.5. Installing Bundler 2.3.5 and restarting using that version. #0 3.696 Fetching gem metadata from https://rubygems.org/. #0 3.768 Fetching bundler 2.3.5 #0 3.902 Installing bundler 2.3.5 #0 4.958 Fetching gem metadata from https://rubygems.org/.......... ... #0 81.24 Fetching sass-rails 6.0.0 #0 81.25 Installing sass-rails 6.0.0 #0 81.29 Gem::Ext::BuildError: ERROR: Failed to build gem native extension. #0 81.29 #0 81.29 current directory: #0 81.29 /rails/vendor/bundle/ruby/3.0.0/gems/sqlite3-1.4.2/ext/sqlite3 #0 81.29 /usr/local/bin/ruby extconf.rb #0 81.29 checking for sqlite3.h... no #0 81.29 sqlite3.h is missing. Try 'brew install sqlite3', #0 81.29 'yum install sqlite-devel' or 'apt-get install libsqlite3-dev' #0 81.29 and check your shared library search path (the #0 81.29 location where your sqlite3 shared library is located). #0 81.29 *** extconf.rb failed *** #0 81.29 Could not create Makefile due to some reason, probably lack of necessary #0 81.29 libraries and/or headers. Check the mkmf.log file for more details. You may #0 81.29 need configuration options. ... #0 81.29 An error occurred while installing sqlite3 (1.4.2), and Bundler cannot continue. #0 81.29 #0 81.29 In Gemfile: #0 81.29 sqlite3 ------ Error: failed to fetch an image or build from source: error building: failed to solve: executor failed running [/bin/sh -c bundle install && bundle exec bootsnap precompile --gemfile && rm -rf ~/.bundle/ $BUNDLE_PATH/ruby/*/cache $BUNDLE_PATH/ruby/*/bundler/gems/*/.git]: exit code: 5
fly doctor, everything passes:
Testing authentication token... PASSED Testing flyctl agent... PASSED Testing local Docker instance... PASSED Pinging WireGuard gateway (give us a sec)... PASSED App specific checks for congress-chart-dev: Checking that app has ip addresses allocated... Nope No ip addresses assigned to this app. If the app is not intended to receive traffic, this is fine. Otherwise, it likely means that the services configuration is not correctly setup to receive http, tls, tcp, or udp traffic. https://fly.io/docs/reference/configuration/#the-services-sections No public ipv4 or ipv6 ip addresses allocated to app congress-chart-dev Build checks for congress-chart-dev: Checking docker context size (this may take little bit)... PASSED (170 kB) Checking for .dockerignore... PASSED
I have tried installing
sqlite3 separately and then running
bundle install, but have had no luck. I also edited the Gemfile to have the following line:
gem 'sqlite3', '~> 1.4', '>= 1.4.2'
Any suggestions on what to do would be very helpful.