我按照OpenShift Windows client tools installation guide中的说明为Windows安装了ruby和git。
当我运行rhc
命令时,我收到此错误:
C:/Ruby23/lib/ruby/gems/2.3.0/gems/commander-4.2.1/lib/commander/user_interaction.rb:328: warning: constant ::TimeoutError is deprecated
C:/Ruby23/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- dl/import (LoadError)
from C:/Ruby23/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in`require'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/pageant.rb:1:in `<top (required)>'
from C:/Ruby23/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in`require'
from C:/Ruby23/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in`require'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/agent/socket.rb:5:in `<top (required)>'
from C:/Ruby23/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in`require'
from C:/Ruby23/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in`require'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/agent.rb:22:in `<top (required)>'
from C:/Ruby23/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in`require'
from C:/Ruby23/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in`require'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/key_manager.rb:4:in `<top (required)>'
from C:/Ruby23/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in`require'
from C:/Ruby23/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in`require'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/session.rb:4:in `<top (required)>'
from C:/Ruby23/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in`require'
from C:/Ruby23/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in`require'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/net-ssh-2.9.2/lib/net/ssh.rb:11:in `<top (required)>'
from C:/Ruby23/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in`require'
from C:/Ruby23/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in`require'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/rhc-1.38.4/lib/rhc/ssh_helpers.rb:18:in `<top (required)>'
from C:/Ruby23/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in`require'
from C:/Ruby23/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in`require'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/rhc-1.38.4/lib/rhc/wizard.rb:77:in `<class:Wizard>'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/rhc-1.38.4/lib/rhc/wizard.rb:7:in `<module:RHC>'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/rhc-1.38.4/lib/rhc/wizard.rb:6:in `<top (required)>'
from C:/Ruby23/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in`require'
from C:/Ruby23/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in`require'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/rhc-1.38.4/lib/rhc/commands/base.rb:4:in `<top (required)>'
from C:/Ruby23/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in`require'
from C:/Ruby23/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in`require'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/rhc-1.38.4/lib/rhc/commands/account.rb:2:in `<module:Commands>'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/rhc-1.38.4/lib/rhc/commands/account.rb:1:in `<top (required)>'
from C:/Ruby23/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in`require'
from C:/Ruby23/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in`require'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/rhc-1.38.4/lib/rhc/commands.rb:189:in `block in load'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/rhc-1.38.4/lib/rhc/commands.rb:188:in `each'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/rhc-1.38.4/lib/rhc/commands.rb:188:in `load'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/rhc-1.38.4/lib/rhc/cli.rb:36:in`start'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/rhc-1.38.4/bin/rhc:20:in `<top (required)>'
from C:/Ruby23/bin/rhc:23:in `load'
from C:/Ruby23/bin/rhc:23:in `<main>'
如何防止此错误并在Windows中运行OpenShift rhc
工具?
答案 0 :(得分:8)
尝试卸载当前的Ruby版本并安装已知在Windows上使用rhc工具的Ruby 1.9.3 for Windows。
修改强>
如下面的评论所述,Windows的Ruby 2.0 也可以使用
所有归档的RubyInstaller版本都可用here。