Error setting up rhc (red hat client tools)

2019-05-10 09:50发布

问题:

I've installed rhc following the instructions on the Openshift website. All seems fine when I run gem install rhc and hgem update rhc but when I try to call rhc I get the following message below. I've tried reinstalling ruby and git, both 32 and 64 messages. I also thought the problem was a missing openssl but installing that made no difference.

I've run out of ideas and any help would be greatly appreciated

c:/local/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `requir
e': cannot load such file -- dl/import (LoadError)
        from c:/local/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:
54:in `require'
        from c:/local/Ruby22/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/
authentication/pageant.rb:1:in `<top (required)>'
        from c:/local/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:
54:in `require'
        from c:/local/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:
54:in `require'
        from c:/local/Ruby22/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/
authentication/agent/socket.rb:5:in `<top (required)>'
        from c:/local/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:
54:in `require'
        from c:/local/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:
54:in `require'
        from c:/local/Ruby22/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/
authentication/agent.rb:22:in `<top (required)>'
        from c:/local/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:
54:in `require'
        from c:/local/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:
54:in `require'
        from c:/local/Ruby22/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/
authentication/key_manager.rb:4:in `<top (required)>'
        from c:/local/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:
54:in `require'
        from c:/local/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:
54:in `require'
        from c:/local/Ruby22/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/
authentication/session.rb:4:in `<top (required)>'
        from c:/local/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:
54:in `require'
        from c:/local/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:
54:in `require'
        from c:/local/Ruby22/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh.
rb:11:in `<top (required)>'
        from c:/local/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:
54:in `require'
        from c:/local/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:
54:in `require'
        from c:/local/Ruby22/lib/ruby/gems/2.2.0/gems/rhc-1.35.1/lib/rhc/ssh_hel
pers.rb:18:in `<top (required)>'
        from c:/local/Ruby22/lib/ruby/gems/2.2.0/gems/rhc-1.35.1/lib/rhc/wizard.
rb:77:in `<class:Wizard>'
        from c:/local/Ruby22/lib/ruby/gems/2.2.0/gems/rhc-1.35.1/lib/rhc/wizard.
rb:7:in `<module:RHC>'
        from c:/local/Ruby22/lib/ruby/gems/2.2.0/gems/rhc-1.35.1/lib/rhc/wizard.
rb:6:in `<top (required)>'
        from c:/local/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:
54:in `require'
        from c:/local/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:
54:in `require'
        from c:/local/Ruby22/lib/ruby/gems/2.2.0/gems/rhc-1.35.1/lib/rhc/command
s/base.rb:4:in `<top (required)>'
        from c:/local/Ruby22/lib/ruby/gems/2.2.0/gems/rhc-1.35.1/lib/rhc/command
s/account.rb:2:in `<module:Commands>'
        from c:/local/Ruby22/lib/ruby/gems/2.2.0/gems/rhc-1.35.1/lib/rhc/command
s/account.rb:1:in `<top (required)>'
        from c:/local/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:
54:in `require'
        from c:/local/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:
54:in `require'
        from c:/local/Ruby22/lib/ruby/gems/2.2.0/gems/rhc-1.35.1/lib/rhc/command
s.rb:189:in `block in load'
        from c:/local/Ruby22/lib/ruby/gems/2.2.0/gems/rhc-1.35.1/lib/rhc/command
s.rb:188:in `each'
        from c:/local/Ruby22/lib/ruby/gems/2.2.0/gems/rhc-1.35.1/lib/rhc/command
s.rb:188:in `load'
        from c:/local/Ruby22/lib/ruby/gems/2.2.0/gems/rhc-1.35.1/lib/rhc/cli.rb:
36:in `start'
        from c:/local/Ruby22/lib/ruby/gems/2.2.0/gems/rhc-1.35.1/bin/rhc:20:in `
<top (required)>'
        from c:/local/Ruby22/bin/rhc:23:in `load'
        from c:/local/Ruby22/bin/rhc:23:in `<main>'

回答1:

Found the solution elsewhere on the site (rhc setup gives error `no such file dl/import`)

gem install net-ssh -v 2.9.3.beta1

...to install a beta version of net-ssh.



回答2:

Check your ruby version. RHC is not compatible with Ruby 2 or later. If so, uninstall ruby and install 1.9.3 version, then gem install rhc and finally rhc setup It worked for me where upgrading net-ssh never fixed the problem



回答3:

Assuming that you have already installed rhc. First uninstall the 2.9.2 version using:

gem uninstall net-ssh -v 2.9.1

Then install

gem install net-ssh -v 2.9.3.beta1

After go to this folder your gems specifications folder: ruby\lib\ruby\gems\version\specifications and edit the rhc-x.xx.x.gemspec by changing all

      s.add_runtime_dependency(%q<net-ssh>, ["<= 2.9.2"])

into

      s.add_runtime_dependency(%q<net-ssh>, [">= 2.9.2"])