gpt4 book ai didi

ruby - dlload' 中的 block 中的救援:无法在运行上限上加载 user32 (Fiddle::DLError)

转载 作者:行者123 更新时间:2023-12-01 18:29:46 26 4
gpt4 key购买 nike

我安装了 Capistrano 2,但在执行上限时遇到问题命令。操作系统是Windows 2012 R2。所以当我运行时,上限<<>>部署,

显示的错误是,

/usr/share/ruby/2.3.0/fiddle/import.rb:86:in `rescue in block in dlload': can't load user32 (Fiddle::DLError)

from /usr/share/ruby/2.3.0/fiddle/import.rb:83:in `block in dlload'
from /usr/share/ruby/2.3.0/fiddle/import.rb:74:in `collect'
from /usr/share/ruby/2.3.0/fiddle/import.rb:74:in `dlload'
from /home/Administrator/.gem/ruby/2.3.0/gems/net-ssh-4.0.1/lib/net/ssh/authentication/pageant.rb:59:in
`<module:Win>'
from /home/Administrator/.gem/ruby/2.3.0/gems/net-ssh-4.0.1/lib/net/ssh/authentication/pageant.rb:41:in
`<module:Pageant>'
from /home/Administrator/.gem/ruby/2.3.0/gems/net-ssh-4.0.1/lib/net/ssh/authentication/pageant.rb:33:in
`<module:Authentication>'
from /home/Administrator/.gem/ruby/2.3.0/gems/net-ssh-4.0.1/lib/net/ssh/authentication/pageant.rb:24:in
`<module:SSH>'
from /home/Administrator/.gem/ruby/2.3.0/gems/net-ssh-4.0.1/lib/net/ssh/authentication/pageant.rb:24:in
`<module:Net>'
from /home/Administrator/.gem/ruby/2.3.0/gems/net-ssh-4.0.1/lib/net/ssh/authentication/pageant.rb:24:in `<top (required)>'
from /usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/share/ruby/site_ruby/rubygems/core_ex/kernel_require.rb:55:in
`require'
from /home/Administrator/.gem/ruby/2.3.0/gems/net-ssh-4.0.1/lib/net/ssh/authentication/agent.rb:9:in
`<top (required)>'
from /usr/local/share/ruby/site_ruby/rubygems/core_ex/kernel_require.rb:55:in
`require'
from /usr/local/share/ruby/site_ruby/rubygems/core_ex/kernel_require.rb:55:in
`require'
from /home/Administrator/.gem/ruby/2.3.0/gems/net-ssh-4.0.1/lib/net/ssh/authentication/key_manager.rb:4:in`<top (required)>'
from /usr/local/share/ruby/site_ruby/rubygems/core_ex/kernel_require.rb:55:in
`require'
from /usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:55:in`require'
from /home/Administrator/.gem/ruby/2.3.0/gems/net-ssh-4.0.1/lib/net/ssh/authentication/session.rb:4:in`<top (required)>'
from /usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:55:in`require'
from /usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/Administrator/.gem/ruby/2.3.0/gems/net-ssh-4.0.1/lib/net/ssh.rb:12:in`<top (required)>'
from /usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:55:in`require'
from /usr/local/share/ruby/site_ruby/rubygems/core_ex/kernel_require.rb:55:in
`require'
from /home/Administrator/.gem/ruby/2.3.0/gems/net-ssh-gateway-2.0.0/lib/net/ssh/gateway.rb:2:in`<top (required)>'
from /usr/local/share/ruby/site_ruby/rubygems/core_ex/kernel_require.rb:55:in
`require'
from /usr/local/share/ruby/site_ruby/rubygems/core_ex/kernel_require.rb:55:in
`require'
from /home/Administrator/.gem/ruby/2.3.0/gems/capistrano-2.15.9/lib/capistrano/configuration/connections.rb:2:in`<top (required)>'
from /usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:55:in`require'
from /usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:55:in`require'
from /home/Administrator/.gem/ruby/2.3.0/gems/capistrano-2.15.9/lib/capistrano/configuration.rb:5:in`<top (required)>'
from /usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:55:in`require'
from /usr/local/share/ruby/site_ruby/rubygems/core_ex/kernel_require.rb:55:in
`require'
from /home/Administrator/.gem/ruby/2.3.0/gems/capistrano-2.15./lib/capistrano.rb:3:in`<top (required)>'
from /usr/local/share/ruby/site_ruby/rubygems/core_ex/kernel_require.rb:55:in
`require'
from /usr/local/share/ruby/site_ruby/rubygems/core_ex/kernel_require.rb:55:in
`require'
from /home/Administrator/.gem/ruby/2.3.0/gems/capistrano-2.15./lib/capistrano/cli.rb:1:in`<top (required)>'
from /usr/local/share/ruby/site_ruby/rubygems/core_ex/kernel_require.rb:55:in
`require'
from /usr/local/share/ruby/site_ruby/rubygems/core_ex/kernel_require.rb:55:in
`require'
from /home/Administrator/.gem/ruby/2.3.0/gems/capistrano-2.15.9/bin/cap:3:in
`<top (required)>'
from /home/Administrator/bin/cap:23:in `load'
from /home/Administrator/bin/cap:23:in `<main>'

My gem environment info is given below -

RubyGems Environment:
- RUBYGEMS VERSION: 2.6.12
- RUBY VERSION: 2.3.3 (2016-11-21 patchlevel 222) [x86_64-cygwin]
- INSTALLATION DIRECTORY: /home/Administrator/.gem/ruby/2.3.0
- USER INSTALLATION DIRECTORY: /home/Administrator/.gem/ruby/2.3.0
- RUBY EXECUTABLE: /usr/bin/ruby.exe
- EXECUTABLE DIRECTORY: /home/Administrator/bin
- SPEC CACHE DIRECTORY: /home/Administrator/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-cygwin
- GEM PATHS:
- /home/Administrator/.gem/ruby/2.3.0
- /usr/share/gems
- /usr/local/share/gems
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /usr/local/bin
- /usr/bin

gem 列表是 -

* 本地 gem *

构建器 (3.2.2)卡皮斯特拉诺 (2.15.9)capistrano-ext (1.2.1)capistrano_rsync_with_remote_cache (2.4.0)did_you_mean (1.0.2)高线 (1.7.8)io-控制台 (0.4.6)json (1.8.6)迷你测试(5.10.1)网络-scp (1.2.1)网络 sftp (2.1.2)网络 ssh (4.0.1)网络 ssh 网关 (2.0.0)心理 (2.2.4)无轨部署 (1.1.2) rake (11.3.0)rdoc(4.3.0)

请指教。

最佳答案

我知道这是一个老问题,但当我试图找到问题的解决方案时,我偶然发现了这里。这是问题中显示的相同错误日志。至少在 Windows 下,这似乎是旧版 ruby​​ 的普遍问题。

我正在运行Cygwin under Windows 7 x64, with RVM and Ruby 2.2.6 ,是的,我知道它很旧。

我在用RVM安装Ruby时遇到了类似的问题,但我暂时解决了它,我认为这只是在制作 ruby 时。但现在我在做 bundle exec cap some_env deploy 时遇到了同样的问题, capistrano正在使用 net-ssh我得到了与问题中相同的错误。

问题是 Fiddle#dlopen没有尝试使用扩展名 .dll 。在当前通话中 Fiddle.dlopen("user32")这会导致它应该尝试使用 Fiddle.dlopen("user32.dll") 的错误.

我做了一个 hack 解决了这个问题,在 ruby-2.2.6/lib/ruby/2.2.0/fiddle/import.rb第 83 行左右:

      begin
Fiddle.dlopen(lib)
rescue DLError
raise(DLError, "can't load #{lib}")
end

我把它改成了

      begin
Fiddle.dlopen(lib)
rescue DLError
if lib.to_s !~ /\.dll/
lib = "#{lib}.dll"
retry
end
raise(DLError, "can't load #{lib}")
end

而且它有效。

关于ruby - dlload' 中的 block 中的救援:无法在运行上限上加载 user32 (Fiddle::DLError),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45496279/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com