Rails 7 Build Fail ( --css bootstrap -d postgres)

PLEASE help this is my first rails deploy and I don’t know how to fix this.

2:59:36 AM: Build ready to start
2:59:38 AM: build-image version: d7b3dbfb0846505993c9a131894d1858074c90b4 (focal)
2:59:38 AM: build-image tag: v4.10.1
2:59:38 AM: buildbot version: 67e75f1ba713a8213d4b5a8ccf9708af751e2390
2:59:38 AM: Fetching cached dependencies
2:59:38 AM: Failed to fetch cache, continuing with build
2:59:38 AM: Starting to prepare the repo for build
2:59:38 AM: No cached dependencies found. Cloning fresh repo
2:59:38 AM: git clone https://github.com/kemister85/Portfolio_2022
2:59:39 AM: Preparing Git Reference refs/heads/main
2:59:39 AM: Parsing package.json dependencies
2:59:40 AM: Starting build script
2:59:40 AM: Installing dependencies
2:59:40 AM: Python version set to 2.7
2:59:40 AM: Downloading and installing node v16.17.0...
2:59:40 AM: Downloading https://nodejs.org/dist/v16.17.0/node-v16.17.0-linux-x64.tar.xz...
2:59:41 AM: Computing checksum with sha256sum
2:59:41 AM: Checksums matched!
2:59:43 AM: Now using node v16.17.0 (npm v8.15.0)
2:59:43 AM: Started restoring cached build plugins
2:59:43 AM: Finished restoring cached build plugins
2:59:43 AM: Required ruby-3.0.0 is not installed.
2:59:43 AM: To install do: 'rvm install "ruby-3.0.0"'
2:59:43 AM: Attempting ruby version ruby-3.0.0, read from .ruby-version file
2:59:43 AM: Required ruby-3.0.0 is not installed - installing.
2:59:44 AM: Searching for binary rubies, this might take some time.
2:59:44 AM: Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/20.04/x86_64/ruby-3.0.0.tar.bz2
2:59:44 AM: Checking requirements for ubuntu.
2:59:44 AM: Requirements installation successful.
2:59:44 AM: ruby-3.0.0 - #configure
2:59:44 AM: ruby-3.0.0 - #download
2:59:45 AM: ruby-3.0.0 - #validate archive
2:59:49 AM: ruby-3.0.0 - #extract
2:59:51 AM: ruby-3.0.0 - #validate binary
2:59:51 AM: ruby-3.0.0 - #setup
2:59:52 AM: ruby-3.0.0 - #gemset created /opt/buildhome/.rvm/gems/ruby-3.0.0@global
2:59:52 AM: ruby-3.0.0 - #importing gemset /opt/buildhome/.rvm/gemsets/global.gems........................................
2:59:52 AM: ruby-3.0.0 - #generating global wrappers........
2:59:52 AM: ruby-3.0.0 - #gemset created /opt/buildhome/.rvm/gems/ruby-3.0.0
2:59:52 AM: ruby-3.0.0 - #importing gemsetfile /opt/buildhome/.rvm/gemsets/default.gems evaluated to empty gem list
2:59:53 AM: ruby-3.0.0 - #generating default wrappers........
2:59:53 AM: Using /opt/buildhome/.rvm/gems/ruby-3.0.0
2:59:53 AM: Using ruby version 3.0.0
2:59:53 AM: Using bundler version 2.3.21 from Gemfile.lock
2:59:54 AM: Successfully installed bundler-2.3.21
2:59:54 AM: 1 gem installed
2:59:54 AM: Using PHP version 8.0
2:59:54 AM: Started restoring cached ruby gems
2:59:54 AM: Finished restoring cached ruby gems
2:59:54 AM: Installing gem bundle
2:59:54 AM: [DEPRECATED] The `--path` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local path '/opt/build/cache/bundle'`, and stop using this flag
2:59:54 AM: [DEPRECATED] The --binstubs option will be removed in favor of `bundle binstubs --all`
2:59:56 AM: Fetching gem metadata from https://rubygems.org/..........
2:59:56 AM: Fetching rake 13.0.6
2:59:56 AM: Installing rake 13.0.6
2:59:56 AM: Fetching concurrent-ruby 1.1.10
2:59:56 AM: Fetching mini_portile2 2.8.0
2:59:56 AM: Fetching crass 1.0.6
2:59:56 AM: Fetching rack 2.2.4
2:59:56 AM: Fetching marcel 1.0.2
2:59:56 AM: Fetching strscan 3.0.4
2:59:56 AM: Fetching bcrypt 3.1.18
2:59:56 AM: Fetching msgpack 1.5.6
2:59:56 AM: Using bundler 2.3.21
2:59:56 AM: Fetching matrix 0.4.2
2:59:56 AM: Fetching method_source 1.0.0
2:59:56 AM: Fetching zeitwerk 2.6.0
2:59:56 AM: Fetching io-console 0.5.11
2:59:56 AM: Fetching dotenv 2.8.1
2:59:56 AM: Fetching ffi 1.15.5
2:59:56 AM: Fetching minitest 5.16.3
2:59:56 AM: Fetching builder 3.2.4
2:59:56 AM: Fetching erubi 1.11.0
2:59:56 AM: Fetching racc 1.6.0
2:59:56 AM: Fetching nio4r 2.5.8
2:59:56 AM: Fetching websocket-extensions 0.1.5
2:59:56 AM: Fetching mini_mime 1.1.2
2:59:56 AM: Fetching timeout 0.3.0
2:59:56 AM: Fetching public_suffix 5.0.0
2:59:56 AM: Fetching bindex 0.8.1
2:59:56 AM: Fetching regexp_parser 2.5.0
2:59:56 AM: Fetching childprocess 4.1.0
2:59:56 AM: Fetching orm_adapter 0.5.0
2:59:56 AM: Fetching mini_magick 4.11.0
2:59:56 AM: Fetching pg 1.4.3
2:59:56 AM: Fetching digest 3.1.0
2:59:56 AM: Fetching thor 1.2.1
2:59:56 AM: Fetching rexml 3.2.5
2:59:56 AM: Installing timeout 0.3.0
2:59:56 AM: Installing dotenv 2.8.1
2:59:56 AM: Installing method_source 1.0.0
2:59:56 AM: Installing strscan 3.0.4 with native extensions
2:59:56 AM: Installing mini_magick 4.11.0
2:59:56 AM: Installing websocket-extensions 0.1.5
2:59:56 AM: Installing orm_adapter 0.5.0
2:59:56 AM: Installing mini_portile2 2.8.0
2:59:56 AM: Installing builder 3.2.4
2:59:56 AM: Installing crass 1.0.6
2:59:56 AM: Installing erubi 1.11.0
2:59:56 AM: Installing bindex 0.8.1 with native extensions
2:59:56 AM: Installing matrix 0.4.2
2:59:56 AM: Installing io-console 0.5.11 with native extensions
2:59:56 AM: Installing childprocess 4.1.0
2:59:56 AM: Installing mini_mime 1.1.2
2:59:56 AM: Installing zeitwerk 2.6.0
2:59:56 AM: Installing digest 3.1.0 with native extensions
2:59:56 AM: Installing thor 1.2.1
2:59:56 AM: Installing marcel 1.0.2
2:59:56 AM: Installing bcrypt 3.1.18 with native extensions
2:59:56 AM: Installing racc 1.6.0 with native extensions
2:59:56 AM: Installing regexp_parser 2.5.0
2:59:56 AM: Installing msgpack 1.5.6 with native extensions
2:59:56 AM: Installing minitest 5.16.3
2:59:56 AM: Installing rexml 3.2.5
2:59:56 AM: Installing public_suffix 5.0.0
2:59:56 AM: Installing nio4r 2.5.8 with native extensions
2:59:56 AM: Fetching rmagick 4.2.6
2:59:56 AM: Fetching rubyzip 2.3.2
2:59:56 AM: Fetching websocket 1.2.9
2:59:56 AM: Installing rack 2.2.4
2:59:56 AM: Fetching websocket-driver 0.7.5
2:59:56 AM: Installing pg 1.4.3 with native extensions
2:59:56 AM: Fetching net-protocol 0.1.3
2:59:56 AM: Installing websocket 1.2.9
2:59:56 AM: Installing websocket-driver 0.7.5 with native extensions
2:59:56 AM: Installing rubyzip 2.3.2
2:59:56 AM: Installing net-protocol 0.1.3
2:59:56 AM: Fetching mail 2.7.1
2:59:56 AM: Installing concurrent-ruby 1.1.10
2:59:57 AM: Installing rmagick 4.2.6 with native extensions
2:59:57 AM: Fetching addressable 2.8.1
2:59:57 AM: Installing mail 2.7.1
2:59:57 AM: Installing ffi 1.15.5 with native extensions
2:59:57 AM: Installing addressable 2.8.1
2:59:57 AM: Fetching selenium-webdriver 4.4.0
2:59:57 AM: Fetching rack-test 2.0.2
2:59:57 AM: Fetching warden 1.2.9
2:59:57 AM: Installing rack-test 2.0.2
2:59:57 AM: Installing warden 1.2.9
2:59:57 AM: Installing selenium-webdriver 4.4.0
2:59:58 AM: Fetching sprockets 4.1.1
2:59:58 AM: Fetching tzinfo 2.0.5
2:59:58 AM: Fetching i18n 1.12.0
2:59:58 AM: Installing i18n 1.12.0
2:59:58 AM: Installing tzinfo 2.0.5
2:59:58 AM: Installing sprockets 4.1.1
2:59:58 AM: Fetching nokogiri 1.13.8
2:59:59 AM: Fetching activesupport 7.0.3.1
2:59:59 AM: Fetching reline 0.3.1
2:59:59 AM: Installing activesupport 7.0.3.1
2:59:59 AM: Installing reline 0.3.1
2:59:59 AM: Fetching irb 1.4.1
2:59:59 AM: Installing irb 1.4.1
2:59:59 AM: Installing nokogiri 1.13.8 with native extensions
2:59:59 AM: Fetching debug 1.6.2
2:59:59 AM: Installing debug 1.6.2 with native extensions
3:00:00 AM: Fetching globalid 1.0.0
3:00:00 AM: Fetching activemodel 7.0.3.1
3:00:00 AM: Installing globalid 1.0.0
3:00:00 AM: Installing activemodel 7.0.3.1
3:00:00 AM: Fetching activejob 7.0.3.1
3:00:00 AM: Fetching activerecord 7.0.3.1
3:00:00 AM: Installing activejob 7.0.3.1
3:00:00 AM: Installing activerecord 7.0.3.1
3:00:02 AM: Fetching puma 5.6.5
3:00:02 AM: Installing puma 5.6.5 with native extensions
3:00:03 AM: Fetching net-imap 0.2.3
3:00:03 AM: Using net-pop 0.1.1
3:00:03 AM: Fetching net-smtp 0.3.1
3:00:03 AM: Installing net-imap 0.2.3
3:00:03 AM: Installing net-smtp 0.3.1
3:00:04 AM: Fetching bootsnap 1.13.0
3:00:04 AM: Installing bootsnap 1.13.0 with native extensions
3:00:07 AM: Fetching sassc 2.4.0
3:00:07 AM: Fetching ruby-vips 2.1.4
3:00:08 AM: Installing ruby-vips 2.1.4
3:00:08 AM: Fetching image_processing 1.12.2
3:00:08 AM: Installing sassc 2.4.0 with native extensions
3:00:08 AM: Installing image_processing 1.12.2
3:01:02 AM: Fetching rails-dom-testing 2.0.3
3:01:02 AM: Fetching xpath 3.2.0
3:01:02 AM: Fetching loofah 2.18.0
3:01:02 AM: Fetching webdrivers 5.0.0
3:01:02 AM: Installing rails-dom-testing 2.0.3
3:01:02 AM: Fetching font-awesome-sass 6.1.2
3:01:02 AM: Installing xpath 3.2.0
3:01:02 AM: Installing loofah 2.18.0
3:01:02 AM: Installing webdrivers 5.0.0
3:01:02 AM: Fetching capybara 3.37.1
3:01:02 AM: Fetching rails-html-sanitizer 1.4.3
3:01:02 AM: Installing rails-html-sanitizer 1.4.3
3:01:02 AM: Fetching actionview 7.0.3.1
3:01:02 AM: Installing font-awesome-sass 6.1.2
3:01:02 AM: Installing capybara 3.37.1
3:01:02 AM: Installing actionview 7.0.3.1
3:01:02 AM: Fetching jbuilder 2.11.5
3:01:02 AM: Fetching actionpack 7.0.3.1
3:01:02 AM: Installing jbuilder 2.11.5
3:01:02 AM: Installing actionpack 7.0.3.1
3:01:02 AM: Fetching actioncable 7.0.3.1
3:01:02 AM: Fetching actionmailer 7.0.3.1
3:01:02 AM: Fetching railties 7.0.3.1
3:01:02 AM: Fetching activestorage 7.0.3.1
3:01:02 AM: Fetching sprockets-rails 3.4.2
3:01:02 AM: Installing sprockets-rails 3.4.2
3:01:02 AM: Installing actionmailer 7.0.3.1
3:01:02 AM: Installing actioncable 7.0.3.1
3:01:02 AM: Installing activestorage 7.0.3.1
3:01:02 AM: Installing railties 7.0.3.1
3:01:03 AM: Fetching actiontext 7.0.3.1
3:01:03 AM: Creating deploy upload records
3:01:03 AM: Fetching actionmailbox 7.0.3.1
3:01:03 AM: Installing actionmailbox 7.0.3.1
3:01:03 AM: Installing actiontext 7.0.3.1
3:01:03 AM: Fetching web-console 4.2.0
3:01:03 AM: Fetching cssbundling-rails 1.1.1
3:01:03 AM: Failed during stage 'building site': Build script returned non-zero exit code: 1
3:01:03 AM: Fetching responders 3.0.1
3:01:03 AM: Fetching dotenv-rails 2.8.1
3:01:03 AM: Fetching jsbundling-rails 1.0.3
3:01:03 AM: Fetching stimulus-rails 1.1.0
3:01:03 AM: Fetching turbo-rails 1.1.1
3:01:03 AM: Fetching rails 7.0.3.1
3:01:03 AM: Installing dotenv-rails 2.8.1
3:01:03 AM: Installing responders 3.0.1
3:01:03 AM: Installing jsbundling-rails 1.0.3
3:01:03 AM: Installing web-console 4.2.0
3:01:03 AM: Installing cssbundling-rails 1.1.1
3:01:03 AM: Installing rails 7.0.3.1
3:01:03 AM: Installing stimulus-rails 1.1.0
3:01:03 AM: Installing turbo-rails 1.1.1
3:01:03 AM: Fetching devise 4.8.1
3:01:03 AM: Installing devise 4.8.1
3:01:03 AM: Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
3:01:03 AM:     current directory: /opt/build/cache/bundle/ruby/3.0.0/gems/pg-1.4.3/ext
3:01:03 AM: /opt/buildhome/.rvm/rubies/ruby-3.0.0/bin/ruby -I
3:01:03 AM: /opt/buildhome/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0 -r
3:01:03 AM: ./siteconf20220831-3131-1ao3se.rb extconf.rb
3:01:03 AM: Calling libpq with GVL unlocked
3:01:03 AM: checking for pg_config... no
3:01:03 AM: checking for libpq per pkg-config... no
3:01:03 AM: Using libpq from
3:01:03 AM: checking for libpq-fe.h... no
3:01:03 AM: Can't find the 'libpq-fe.h header
3:01:03 AM: *****************************************************************************
3:01:03 AM: Unable to find PostgreSQL client library.
3:01:03 AM: Please install libpq or postgresql client package like so:
3:01:03 AM:   sudo apt install libpq-dev
3:01:03 AM:   sudo yum install postgresql-devel
3:01:03 AM:   sudo zypper in postgresql-devel
3:01:03 AM:   sudo pacman -S postgresql-libs
3:01:03 AM: or try again with:
3:01:03 AM:   gem install pg -- --with-pg-config=/path/to/pg_config
3:01:03 AM: or set library paths manually with:
3:01:03 AM: gem install pg -- --with-pg-include=/path/to/libpq-fe.h/
3:01:03 AM: --with-pg-lib=/path/to/libpq.so/
3:01:03 AM: *** extconf.rb failed ***
3:01:03 AM: Could not create Makefile due to some reason, probably lack of necessary
3:01:03 AM: libraries and/or headers.  Check the mkmf.log file for more details.  You may
3:01:03 AM: need configuration options.
3:01:03 AM: Provided configuration options:
3:01:03 AM: 	--with-opt-dir
3:01:03 AM: 	--without-opt-dir
3:01:03 AM: 	--with-opt-include
3:01:03 AM: 	--without-opt-include=${opt-dir}/include
3:01:03 AM: 	--with-opt-lib
3:01:03 AM: 	--without-opt-lib=${opt-dir}/lib
3:01:03 AM: 	--with-make-prog
3:01:03 AM: 	--without-make-prog
3:01:03 AM: 	--srcdir=.
3:01:03 AM: 	--curdir
3:01:03 AM: 	--ruby=/opt/buildhome/.rvm/rubies/ruby-3.0.0/bin/$(RUBY_BASE_NAME)
3:01:03 AM: 	--with-pg
3:01:03 AM: 	--without-pg
3:01:03 AM: 	--enable-gvl-unlock
3:01:03 AM: 	--disable-gvl-unlock
3:01:03 AM: 	--enable-windows-cross
3:01:03 AM: 	--disable-windows-cross
3:01:03 AM: 	--with-pg-config
3:01:03 AM: 	--without-pg-config
3:01:03 AM: 	--with-pg_config
3:01:03 AM: 	--without-pg_config
3:01:03 AM: 	--with-libpq-config
3:01:03 AM: 	--without-libpq-config
3:01:03 AM: 	--with-pkg-config
3:01:03 AM: 	--without-pkg-config
3:01:03 AM: 	--with-pg-dir
3:01:03 AM: 	--without-pg-dir
3:01:03 AM: 	--with-pg-include
3:01:03 AM: 	--without-pg-include=${pg-dir}/include
3:01:03 AM: 	--with-pg-lib
3:01:03 AM: 	--without-pg-lib=${pg-dir}/lib
3:01:03 AM: To see why this extension failed to compile, please check the mkmf.log which can
3:01:03 AM: be found here:
3:01:03 AM: /opt/build/cache/bundle/ruby/3.0.0/extensions/x86_64-linux/3.0.0/pg-1.4.3/mkmf.log
3:01:03 AM: extconf failed, exit code 1
3:01:03 AM: Gem files will remain installed in
3:01:03 AM: /opt/build/cache/bundle/ruby/3.0.0/gems/pg-1.4.3 for inspection.
3:01:03 AM: Results logged to
3:01:03 AM: /opt/build/cache/bundle/ruby/3.0.0/extensions/x86_64-linux/3.0.0/pg-1.4.3/gem_make.out
3:01:03 AM: /opt/buildhome/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/rubygems/ext/builder.rb:90:in
3:01:03 AM: `run'/opt/buildhome/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/rubygems/ext/ext_conf_builder.rb:48:in`block in build'  /opt/buildhome/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/tempfile.rb:317:in `open'/opt/buildhome/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/rubygems/ext/ext_conf_builder.rb:28:in`build'/opt/buildhome/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/rubygems/ext/builder.rb:156:in
3:01:03 AM: `build_extension'/opt/buildhome/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/rubygems/ext/builder.rb:190:in`block in build_extensions'/opt/buildhome/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/rubygems/ext/builder.rb:187:in
3:01:03 AM: `each'/opt/buildhome/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/rubygems/ext/builder.rb:187:in`build_extensions'/opt/buildhome/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/rubygems/installer.rb:821:in
3:01:03 AM: `build_extensions'/opt/buildhome/.rvm/gems/ruby-3.0.0/gems/bundler-2.3.21/lib/bundler/rubygems_gem_installer.rb:72:in`build_extensions'/opt/buildhome/.rvm/gems/ruby-3.0.0/gems/bundler-2.3.21/lib/bundler/rubygems_gem_installer.rb:28:in
3:01:03 AM: `install'/opt/buildhome/.rvm/gems/ruby-3.0.0/gems/bundler-2.3.21/lib/bundler/source/rubygems.rb:207:in`install'/opt/buildhome/.rvm/gems/ruby-3.0.0/gems/bundler-2.3.21/lib/bundler/installer/gem_installer.rb:54:in
3:01:03 AM: `install'/opt/buildhome/.rvm/gems/ruby-3.0.0/gems/bundler-2.3.21/lib/bundler/installer/gem_installer.rb:16:in`install_from_spec'/opt/buildhome/.rvm/gems/ruby-3.0.0/gems/bundler-2.3.21/lib/bundler/installer/parallel_installer.rb:186:in
3:01:03 AM: `do_install'/opt/buildhome/.rvm/gems/ruby-3.0.0/gems/bundler-2.3.21/lib/bundler/installer/parallel_installer.rb:177:in`block in worker_pool'/opt/buildhome/.rvm/gems/ruby-3.0.0/gems/bundler-2.3.21/lib/bundler/worker.rb:62:in
3:01:03 AM: `apply_func'/opt/buildhome/.rvm/gems/ruby-3.0.0/gems/bundler-2.3.21/lib/bundler/worker.rb:57:in`block in process_queue'/opt/buildhome/.rvm/gems/ruby-3.0.0/gems/bundler-2.3.21/lib/bundler/worker.rb:54:in
3:01:03 AM: `loop'/opt/buildhome/.rvm/gems/ruby-3.0.0/gems/bundler-2.3.21/lib/bundler/worker.rb:54:in`process_queue'/opt/buildhome/.rvm/gems/ruby-3.0.0/gems/bundler-2.3.21/lib/bundler/worker.rb:91:in
3:01:03 AM: `block (2 levels) in create_threads'An error occurred while installing pg (1.4.3), and Bundler cannot continue.In Gemfile:  pgError during gem install
3:01:03 AM: Build was terminated: Build script returned non-zero exit code: 1
3:01:03 AM: Failing build: Failed to build site
3:01:03 AM: Finished processing build request in 1m25.630735622s

Hiya, sorry you are having trouble with your build.

This Support Guide contains a ton of useful debugging tips that can likely help you solve your problem :slight_smile: Additionally, this Support Guide houses all of our resources for debugging build and deploy issues.

We also recommend trying to search the forums with the build error you encountered - it’s likely your question was already asked by someone else!

If you are still having problems, please provide as much information as you can on what you have already tried, what your build settings are, your package.json, a link to your site, etc. Thanks!