-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ruby 3 Windows 10 Gem load Error #365
Comments
I am running into the same issue. I have installed Ruby-3.0.0 with RubyInstaller DevKit (Windows 10). The pg gem (v1.2.3) installs successfully, but when I start my local Rails App (in RubyMine, v 2020.3.1) I receive this error: I did notice that pg gem (https://rubygems.org/gems/pg/versions/1.2.3-x64-mingw32) required ruby versions is listed as: >= 2.2, < 2.8.dev. [Environment Details] |
Hi, same issue here Ruby 3.0.0 **this happens on rake db:create**PS C:\Rails Projekte\ab 2020\pmaster> rake db:create
C:/Ruby30-x64/lib/ruby/3.0.0/ostruct.rb:110: warning: already initialized constant OpenStruct::VERSION
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ostruct-0.3.2/lib/ostruct.rb:110: warning: previous definition of VERSION was here
C:/Ruby30-x64/lib/ruby/3.0.0/ostruct.rb:336: warning: already initialized constant OpenStruct::InspectKey
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ostruct-0.3.2/lib/ostruct.rb:347: warning: previous definition of InspectKey was here
rake aborted!
Bundler::GemRequireError: There was an error while trying to load the gem 'pg'.
Gem Load Error is: AddDllDirectory failed for C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/pg-1.2.3/lib/x64-mingw32
Backtrace for gem load error is:
C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/ruby_installer/runtime/dll_directory.rb:83:in `add_dll_directory_winapi'
C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/ruby_installer/runtime/dll_directory.rb:50:in `initialize'
C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/ruby_installer/runtime/singleton.rb:12:in `new'
C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/ruby_installer/runtime/singleton.rb:12:in `add_dll_directory'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/pg-1.2.3/lib/pg.rb:15:in `block in <main>'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/pg-1.2.3/lib/pg.rb:26:in `rescue in <main>'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/pg-1.2.3/lib/pg.rb:4:in `<main>'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
Caused by:
RubyInstaller::Runtime::DllDirectory::WinApiError: AddDllDirectory failed for C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/pg-1.2.3/lib/x64-mingw32
C:/Rails Projekte/ab 2020/pmaster/config/application.rb:7:in `<top (required)>'
C:/Rails Projekte/ab 2020/pmaster/Rakefile:4:in `require_relative'
C:/Rails Projekte/ab 2020/pmaster/Rakefile:4:in `<top (required)>'
Caused by:
LoadError: 126: Das angegebene Modul wurde nicht gefunden. - C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/pg-1.2.3/lib/pg_ext.so
C:/Rails Projekte/ab 2020/pmaster/config/application.rb:7:in `<top (required)>'
C:/Rails Projekte/ab 2020/pmaster/Rakefile:4:in `require_relative'
C:/Rails Projekte/ab 2020/pmaster/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)
PS C:\Rails Projekte\ab 2020\pmaster> **this happens on rails s**C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/bundler/runtime.rb:69:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'pg'. (Bundler::GemRequireError)
Gem Load Error is: AddDllDirectory failed for C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/pg-1.2.3/lib/x64-mingw32
Backtrace for gem load error is:
C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/ruby_installer/runtime/dll_directory.rb:83:in `add_dll_directory_winapi'
C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/ruby_installer/runtime/dll_directory.rb:50:in `initialize'
C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/ruby_installer/runtime/singleton.rb:12:in `new'
C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/ruby_installer/runtime/singleton.rb:12:in `add_dll_directory'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/pg-1.2.3/lib/pg.rb:15:in `block in <main>'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/pg-1.2.3/lib/pg.rb:26:in `rescue in <main>'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/pg-1.2.3/lib/pg.rb:4:in `<main>'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/bundler/runtime.rb:66:in `block (2 levels) in require'
C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/bundler/runtime.rb:61:in `each'
C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/bundler/runtime.rb:61:in `block in require'
C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/bundler/runtime.rb:50:in `each'
C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/bundler/runtime.rb:50:in `require'
C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/bundler.rb:173:in `require'
C:/Rails Projekte/ab 2020/pmaster/config/application.rb:7:in `<main>'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:332:in `block in require'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:299:in `load_dependency'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:332:in `require'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.1/lib/rails/commands/server/server_command.rb:138:in `block in perform'
<internal:kernel>:90:in `tap'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.1/lib/rails/commands/server/server_command.rb:135:in `perform'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.1/lib/rails/command/base.rb:69:in `perform'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.1/lib/rails/command.rb:50:in `invoke'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.1/lib/rails/commands.rb:18:in `<main>'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:332:in `block in require'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:299:in `load_dependency'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:332:in `require'
bin/rails:4:in `<main>'
Bundler Error Backtrace:
from C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/bundler/runtime.rb:65:in `block (2 levels) in require'
from C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/bundler/runtime.rb:61:in `each'
from C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/bundler/runtime.rb:61:in `block in require'
from C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/bundler/runtime.rb:50:in `each'
from C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/bundler/runtime.rb:50:in `require'
from C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/bundler.rb:173:in `require'
from C:/Rails Projekte/ab 2020/pmaster/config/application.rb:7:in `<main>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:332:in `block in require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:299:in `load_dependency'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:332:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.1/lib/rails/commands/server/server_command.rb:138:in `block in perform'
from <internal:kernel>:90:in `tap'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.1/lib/rails/commands/server/server_command.rb:135:in `perform'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.1/lib/rails/command/base.rb:69:in `perform'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.1/lib/rails/command.rb:50:in `invoke'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.1/lib/rails/commands.rb:18:in `<main>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:332:in `block in require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:299:in `load_dependency'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:332:in `require'
from bin/rails:4:in `<main>'
C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/ruby_installer/runtime/dll_directory.rb:83:in `add_dll_directory_winapi': AddDllDirectory failed for C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/pg-1.2.3/lib/x64-mingw32 (RubyInstaller::Runtime::DllDirectory::WinApiError)
from C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/ruby_installer/runtime/dll_directory.rb:50:in `initialize'
from C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/ruby_installer/runtime/singleton.rb:12:in `new'
from C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/ruby_installer/runtime/singleton.rb:12:in `add_dll_directory'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/pg-1.2.3/lib/pg.rb:15:in `block in <main>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/pg-1.2.3/lib/pg.rb:26:in `rescue in <main>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/pg-1.2.3/lib/pg.rb:4:in `<main>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
from C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/bundler/runtime.rb:66:in `block (2 levels) in require'
from C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/bundler/runtime.rb:61:in `each'
from C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/bundler/runtime.rb:61:in `block in require'
from C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/bundler/runtime.rb:50:in `each'
from C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/bundler/runtime.rb:50:in `require'
from C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/bundler.rb:173:in `require'
from C:/Rails Projekte/ab 2020/pmaster/config/application.rb:7:in `<main>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:332:in `block in require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:299:in `load_dependency'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:332:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.1/lib/rails/commands/server/server_command.rb:138:in `block in perform'
from <internal:kernel>:90:in `tap'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.1/lib/rails/commands/server/server_command.rb:135:in `perform'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.1/lib/rails/command/base.rb:69:in `perform'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.1/lib/rails/command.rb:50:in `invoke'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.1/lib/rails/commands.rb:18:in `<main>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:332:in `block in require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:299:in `load_dependency'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:332:in `require'
from bin/rails:4:in `<main>'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require': 126: Das angegebene Modul wurde nicht gefunden. - C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/pg-1.2.3/lib/pg_ext.so (LoadError)
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:332:in `block in require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:299:in `load_dependency'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:332:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/pg-1.2.3/lib/pg.rb:5:in `<main>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
from C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/bundler/runtime.rb:66:in `block (2 levels) in require'
from C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/bundler/runtime.rb:61:in `each'
from C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/bundler/runtime.rb:61:in `block in require'
from C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/bundler/runtime.rb:50:in `each'
from C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/bundler/runtime.rb:50:in `require'
from C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/bundler.rb:173:in `require'
from C:/Rails Projekte/ab 2020/pmaster/config/application.rb:7:in `<main>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:332:in `block in require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:299:in `load_dependency'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:332:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.1/lib/rails/commands/server/server_command.rb:138:in `block in perform'
from <internal:kernel>:90:in `tap'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.1/lib/rails/commands/server/server_command.rb:135:in `perform'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.1/lib/rails/command/base.rb:69:in `perform'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.1/lib/rails/command.rb:50:in `invoke'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.1/lib/rails/commands.rb:18:in `<main>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:332:in `block in require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:299:in `load_dependency'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.1/lib/active_support/dependencies.rb:332:in `require'
from bin/rails:4:in `<main>'
C:\Rails Projekte\ab 2020\pmaster> |
This happens, if pg gem is installed with a dedicated PostgreSQL installation. I'll update the pg gem soon to fix this and to distribute ruby-3.0 compatible binary gems, but until then there are 3 workarounds:
|
Neither solution works for me. |
this worked but idk why looking for answers :/ |
@larskanis Any update on the Ruby 3.0 compatible gem updates? I'm in the same boat -- only downgrading Ruby seems to fix this on my Windows machine. |
any news? |
I would like to know as soon as the gem is fixed |
it would be nice if someone could do something about the breaking bug. is it so difficult to build against a new version? |
Something I'm noticing here is that rg.rb rescues a Changing the rescue to a WinApiError causes the load to break somewhere entirely different:
I suspect this is part of the problem, or at least a latent bug. It doesn't seem like the use of WinApiError is a recent change or anything. |
1 worked for me. |
... and add it to the search paths on Windows which lacks rpath. In ELF based systems the libpq path is stored as rpath in pg_ext.so, so that libpq is found, even if it's not in the library search paths. On Windows however the rpath mechanism doesn't work and the search path for libpq must be added manually. This is done per RubyInstaller::Runtime.add_dll_directory. The libpq path is available in extconf.rb while build only (while gem install), so that we have to pass the string to lib/pg.rb where pg_ext.so is loaded (while require 'pg'). This is a bit tricky, since pg_ext.so is linked to libpq, so that the library search path has to be set first, prior to loading pg_ext.so. Therefore a second file is needed bypassing pg_ext.so. That is postgresql_lib_path.rb and it is passed by mkmf's $INSTALLFILES mechanism. There's an issue with rake-compiler, which (in contrast to gem install) doesn't copy postgresql_lib_path.rb. This has to be addressed separatelly. Another approach would be to add a second extension file, but that is more complicated. Fixes ged#365
... and add it to the search paths on Windows which lacks rpath. In ELF based systems the libpq path is stored as rpath in pg_ext.so, so that libpq is found, even if it's not in the library search paths. On Windows however the rpath mechanism doesn't work and the search path for libpq must be added manually. This is done per RubyInstaller::Runtime.add_dll_directory. The libpq path is available in extconf.rb while build only (while gem install), so that we have to pass the string to lib/pg.rb where pg_ext.so is loaded (while require 'pg'). This is a bit tricky, since pg_ext.so is linked to libpq, so that the library search path has to be set first, prior to loading pg_ext.so. Therefore a second file is needed bypassing pg_ext.so. That is postgresql_lib_path.rb and it is passed by mkmf's $INSTALLFILES mechanism. There's an issue with rake-compiler, which (in contrast to gem install) doesn't copy postgresql_lib_path.rb. This has to be addressed separatelly. Another approach would be to add a second extension file, but that is more complicated. Fixes ged#365
... and add it to the search paths on Windows which lacks rpath. In ELF based systems the libpq path is stored as rpath in pg_ext.so, so that libpq is found, even if it's not in the library search paths. On Windows however the rpath mechanism doesn't work and the search path for libpq must be added manually. This is done per RubyInstaller::Runtime.add_dll_directory. The libpq path is available in extconf.rb while build only (while gem install), so that we have to pass the string to lib/pg.rb where pg_ext.so is loaded (while require 'pg'). This is a bit tricky, since pg_ext.so is linked to libpq, so that the library search path has to be set first, prior to loading pg_ext.so. Therefore a second file is needed bypassing pg_ext.so. That is postgresql_lib_path.rb and it is passed by mkmf's $INSTALLFILES mechanism. There's an issue with rake-compiler, which (in contrast to gem install) doesn't copy postgresql_lib_path.rb. This has to be addressed separatelly. Another approach would be to add a second extension file, but that is more complicated. Fixes ged#365
I'm not understand... One month ago this procedure not has been worked for me and now it's work. I'm happy :D |
Im getting this error running the command
|
step-1 worked for me. Thanks |
Thanks so much! this worked for me in 2021. |
This is not just Windows 10. This also happen on Windows 8.1. It happen during making the gem.
... many more RSpec errors ... Here is the critical error:
The file exists:
I'm following the instructions for Windows: https://github.com/ged/ruby-pg/blob/master/README-Windows.rdoc
Setting the
|
Oh my. This did work. I could have sworn I had
This did work (without the quotes around the path):
|
this solution works for me, on ruby 3.0.2, windows 10, postgresql 13 |
I had a similar problem in Windows 11 with Command Prompt, but I solved the problem by simply opening Git Bash in the VSCODE terminal and executing the commands |
Nothing has ever worked for me. Such a bummer, any news on this issue? It's been a few years since it first started. |
pg-1.3.0 is released, adding support for ruby-3.0 and 3.1 on Windows to the fat binary gems. Sorry for the long delay! |
Thanks!!! ❤️ Works like a charm. |
Let's go! Nice job |
i still have this trouble.. i've tried the
I am so lost by this, since my ruby and rails installation seems to works fine |
It happens to all of us, even the best of us :) https://github.com/will/bundle Try |
Three years and three minor Ruby versions later and I got bitten by this, too. Nb. 1. was the solution, thank you! Ruby 3.3.0, postgres installed locally. Installing the pg 1.5.2. x64-mingw-ucrt gem gave that "module not found" error. Had to remove the gem, download and install msys2 package x64-ucrt-postgresql and all its dependencies and then the pg gem. |
Thanks a lot. It's fixed for me:
|
This was very helpful, but keep in mind that command is specific for x86_64, which even on an 86_64 processor this may not be the right architecture for your Ruby install. If you're still having issues be sure to use the more generic command:
|
When I run 'rails s', I receive the following error:
D:/RubyInstaller/Ruby3.0.0/lib/ruby/site_ruby/3.0.0/ruby_installer/runtime/dll_directory.rb:83:in `add_dll_directory_winapi': AddDllDirectory failed for D:/RubyInstaller/Ruby3.0.0/lib/ruby/gems/3.0.0
/gems/pg-1.2.3/lib/x64-mingw32 (RubyInstaller::Runtime::DllDirectory::WinApiError)
It seems like there is some problem with gem installation process.
directory structure of pg gem installed in ruby 2.7:
directory structure of pg gem installed in ruby 3.0:
[Environment Details]
Ruby 3.0.0
Rails 6.1.0
Pg 1.2.3
PostgreSQL version: 10
OS: Windows10 (not WOL)
The text was updated successfully, but these errors were encountered: