diff --git a/Gemfile b/Gemfile index 22fa6ec5..cbc9cc5b 100644 --- a/Gemfile +++ b/Gemfile @@ -9,11 +9,7 @@ gem 'rails', '~> 6.1.0', '>= 6.1.7.5' gem 'psych', '3.3.2' # Exactly match the version on Ruby 3.0 # Use postgresql as the database for Active Record -if /\A3[.][01][.]/.match?(RUBY_VERSION) - gem 'pg', '~> 1.2.3' # Support old CentOS 7 PostgreSQL client 9.2.24 for as long as possible -else - gem 'pg' # Drop CentOS 7 support for ruby 3.2 -end +gem 'pg', '~> 1.4.6' # All client instance have postgres version >= 9.3 # use Puma as the app server gem 'puma', '~> 6.0' @@ -95,8 +91,8 @@ gem 'ndr_support', '~> 5.9' gem 'ndr_ui' gem 'ndr_workflow', '~> 1.2', '>= 1.2.2' -gem 'caxlsx', '~> 4' gem 'bootstrap-table-rails', '~> 1.20.2' +gem 'caxlsx', '~> 4' gem 'loofah', '>= 2.3.1' # address CVE-2019-15587 gem 'nokogiri', '~> 1.11' diff --git a/Gemfile.lock b/Gemfile.lock index 6c6c0bd9..f9578455 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -356,7 +356,7 @@ GEM hashery (~> 2.0) ruby-rc4 ttfunk - pg (1.2.3) + pg (1.4.6) possibly (1.0.1) power_assert (2.0.3) prometheus-client (4.0.0) @@ -578,7 +578,7 @@ DEPENDENCIES paper_trail (~> 12.0) paper_trail-association_tracking parser - pg (~> 1.2.3) + pg (~> 1.4.6) possibly pry pry-rails diff --git a/config/deploy.rb b/config/deploy.rb index 165fba0a..8363eef3 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -212,8 +212,19 @@ task :configure do # We need to use local configuration, because global configuration will be "global" for the # deploying user, rather than the application user. + # You can override the path using e.g. set :pg_conf_path, '/usr/pgsql-9.5/bin/pg_config' + # otherwise the latest installed version will be used. run <<~SHELL - cd #{release_path} && bundle config --local build.pg --with-pg-config=/usr/pgsql-9.5/bin/pg_config + set -e; + cd #{release_path}; + pg_conf_path="#{fetch(:pg_conf_path, '')}"; + if [ -z "$pg_conf_path" ]; then + pg_conf_path=`ls -1d /usr/pgsql-{9,[1-8]*}/bin/pg_config 2> /dev/null | tail -1`; + fi; + if [ -n "$pg_conf_path" ]; then + echo Using pg_conf_path=\"$pg_conf_path\"; + bundle config --local build.pg --with-pg-config="$pg_conf_path"; + fi SHELL end end diff --git a/vendor/cache/pg-1.2.3.gem b/vendor/cache/pg-1.2.3.gem deleted file mode 100644 index 0a019bfd..00000000 Binary files a/vendor/cache/pg-1.2.3.gem and /dev/null differ diff --git a/vendor/cache/pg-1.4.6.gem b/vendor/cache/pg-1.4.6.gem new file mode 100644 index 00000000..64045606 Binary files /dev/null and b/vendor/cache/pg-1.4.6.gem differ