When running rails server it crashes an error when connecting to postgres:

gems/pg-1.5.6/lib/pg/connection.rb:695: [BUG] Segmentation fault at 0x000000011e280ac2
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin23]

-- Crash Report log information --------------------------------------------
   See Crash Report log file in one of the following locations:             
     * ~/Library/Logs/DiagnosticReports                                     
     * /Library/Logs/DiagnosticReports                                      
   for more details.                                                        
Don't forget to include the above Crash Report log file in bug reports.     

-- Control frame information -----------------------------------------------

You need to add the line below in .zshrc file and restart shell, or enter source ~/.zshrc command to load the updated config.

export PGGSSENCMODE="disable"

PGGSSENCMODE is an environment variable used in PostgreSQL to configure the GSSAPI (Generic Security Services Application Programming Interface) encryption mode. When PGGSSENCMODE is set to disable, it means that GSSAPI encryption is disabled.

GSSAPI is a standard security interface that provides authentication and data protection in distributed systems. In the context of PostgreSQL, GSSAPI can be used to encrypt database connections.