Project

General

Profile

Error is: AddDllDirectory failed for path_to_gems/pg-1.2.3/lib/x64-mingw-ucrt during fresh redmine5 installation

Added by nonofyour business 9 months ago

Hello my friends,

I am currently trying a fresh install of redmine using this guide: https://www.redmine.org/projects/redmine/wiki/RedmineInstall and I am stuck (details below). Kindly asking for help :)

Versions:
  • Windows Major:10 Minor:0 Build:19945 Revision:0
  • not using cygwin
  • redmine 5.0.5 (going for the latest release)
  • ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x64-mingw-ucrt] (should be the highest compatible version)
  • Rails 6.1.7.2
  • Database: PostgreSQL 15.3

i tried using script/about for getting environment information as stated in How to request help, but it was fruitless or I just don't know where to look for the output file, and I was not able to find a solution online
In ruby shell:

C:\tools\redmine-5.0.5>set RAILS_EMV=production
C:\tools\redmine-5.0.5>script/about
Skript gestartet, Ausgabeprotokolldatei ist »/about«.
sh-5.2$
Errors appear while using:
  • bundle exec rake generate_secret_token
  • bundle exec rake db:migrate
    ruby command line outputs attached (with --trace).

snippet from outputs:

rake aborted!
Bundler::GemRequireError: There was an error while trying to load the gem 'pg'.
Gem Load Error is: AddDllDirectory failed for C:/Users/user1/.local/share/gem/ruby/3.1.0/gems/pg-1.2.3/lib/x64-mingw-ucrt

C:\Users\user1\.local\share\gem\ruby\3.1.0\gems\pg-1.2.3\lib>ls
pg  pg.rb  pg_ext.so

It seems to me that pg 1.2.3 was not installed as expected because "path_to_gems"\pg-1.2.3/lib/x64-mingw-ucrt folder is missing.
I had errors before when running "bundle install" where pg 1.2.3 was missing libraries to install. Those went away when I tried gem intall pg -v '1.2.3' -- --with-pg-dir=C:\tools\postgresql in ruby shell.
(Which may be good addition to the installation guide if this is normal)

My gut feeling is, something is still missing in the pg installation or maybe my PostgreSQL 15.3 or even other versions are wrong? The installation guide stated PostgreSQL9.2 or higher but no maximum version, so I just tried the newest one..

Thanks in advance and Br, harrlow


Replies (1)

RE: Error is: AddDllDirectory failed for path_to_gems/pg-1.2.3/lib/x64-mingw-ucrt during fresh redmine5 installation - Added by Christopher Maximov 7 months ago

Hi.
Stumbled upon the same issue.
It is actually described in https://github.com/ged/ruby-pg/issues/365.
In essence for ruby-3 and above there needs to be at least pg-1.3.0 used, as these are the only ones supporting ruby-3 on windows.
I hope this is recognized in redmine project and tested with pg-1.3.0 series.
If you manually update Gems file in main redmine folder to set gem "pg", "~> 1.3.0" then it get proper libraries and runs.
However i cannot say anything about compatibility of pg-1.2 series with pg-1.3 series....

Anyone can comment??

Chris

    (1-1/1)