shpigford
shpigford
RRailway
Created by shpigford on 9/12/2023 in #✋|help
Unable to find PostgreSQL client library
Setting up a Rails + Postgres app but deployment is failing due to an "Unable to find PostgreSQL client library" error. ``` #11 61.22 Gem::Ext::BuildError: ERROR: Failed to build gem native extension. #11 61.22 #11 61.22 current directory: /usr/local/bundle/ruby/3.1.0/gems/pg-1.5.4/ext #11 61.22 /usr/local/bin/ruby -I /usr/local/lib/ruby/3.1.0 extconf.rb #11 61.22 Calling libpq with GVL unlocked #11 61.22 checking for pg_config... no #11 61.22 checking for libpq per pkg-config... no #11 61.22 Using libpq from #11 61.22 checking for libpq-fe.h... no #11 61.22 Can't find the 'libpq-fe.h header #11 61.22 ** #11 61.22 Unable to find PostgreSQL client library. #11 61.22 #11 61.22 Please install libpq or postgresql client package like so: #11 61.22 sudo apt install libpq-dev #11 61.22 sudo yum install postgresql-devel #11 61.22 sudo zypper in postgresql-devel #11 61.22 sudo pacman -S postgresql-libs #11 61.22 #11 61.22 or try again with: #11 61.22 gem install pg -- --with-pg-config=/path/to/pg_config #11 61.22 #11 61.22 or set library paths manually with: #11 61.22 gem install pg -- --with-pg-include=/path/to/libpq-fe.h/ #11 61.22 --with-pg-lib=/path/to/libpq.so/ #11 61.22 #11 61.22 ** extconf.rb failed ***
5 replies
RRailway
Created by shpigford on 12/22/2022 in #✋|help
File attachments in Rails app not working
I've got a Rails 7 app that's using ActiveStorage to upload files to S3. This works fine locally (still uploading to S3), but error's out in production on Railway. I'm not able to get good logs from Railway (doesn't seem to be a logger built in other than deploys) and the only error I get from the app is:
ActiveRecord::RecordNotSaved
Failed to save the new associated file_attachment
ActiveRecord::RecordNotSaved
Failed to save the new associated file_attachment
Not sure what else to do here. Wondering if it's got something to do with how Railway handles the temp file before sending to S3? But really...no actual idea here.
5 replies