Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Attempt to fix old ruby pg segfault
Browse files Browse the repository at this point in the history
albus522 committed Aug 14, 2024
1 parent d0199ff commit 654ae9b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions spec/helper.rb
Original file line number Diff line number Diff line change
@@ -36,6 +36,11 @@
db_adapter ||= gemfile && gemfile[%r{gemfiles/(.*?)/}] && $1 # rubocop:disable Style/PerlBackrefs
db_adapter ||= "sqlite3"

if db_adapter == "postgresql" && RUBY_VERSION < "2.4"
# Fixes a seg fault for old ruby
ENV["PGGSSENCMODE"] = "disable"
end

if db_adapter == "trilogy" && Gem::Version.new("7.1") > Gem::Version.new(ActiveRecord::VERSION::STRING)
require "trilogy_adapter/connection"
ActiveSupport.on_load(:active_record) { extend TrilogyAdapter::Connection }

0 comments on commit 654ae9b

Please sign in to comment.