Skip to content

Commit

Permalink
Attempt to fix old ruby pg segfault
Browse files Browse the repository at this point in the history
  • Loading branch information
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
Expand Up @@ -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 }
Expand Down

0 comments on commit 654ae9b

Please sign in to comment.