158

I'm installing openshift client tools as described: https://developers.openshift.com/en/getting-started-windows.html#client-tools. On step 'Setting up Your Machine' I got error:

rhc setup C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require' : cannot load such file -- dl/import (LoadError)

Full stack trace:

C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- dl/import (LoadError)
        from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/pageant.rb:1:in `<top (required)>'
        from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/Ruby22-x64/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:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/agent.rb:22:in `<top (required)>'
        from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/Ruby22-x64/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:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/session.rb:4:in `<top (required)>'
        from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh.rb:11:in `<top (required)>'
        from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rhc-1.35.1/lib/rhc/ssh_helpers.rb:18:in `<top (required)>'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rhc-1.35.1/lib/rhc/wizard.rb:77:in `<class:Wizard>'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rhc-1.35.1/lib/rhc/wizard.rb:7:in `<module:RHC>'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rhc-1.35.1/lib/rhc/wizard.rb:6:in `<top (required)>'
        from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rhc-1.35.1/lib/rhc/commands/base.rb:4:in `<top (required)>'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rhc-1.35.1/lib/rhc/commands/account.rb:2:in `<module:Commands>'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rhc-1.35.1/lib/rhc/commands/account.rb:1:in `<top (required)>'
        from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rhc-1.35.1/lib/rhc/commands.rb:189:in `block in load'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rhc-1.35.1/lib/rhc/commands.rb:188:in `each'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rhc-1.35.1/lib/rhc/commands.rb:188:in `load'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rhc-1.35.1/lib/rhc/cli.rb:36:in `start'
        from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rhc-1.35.1/bin/rhc:20:in `<top (required)>'
        from C:/Ruby22-x64/bin/rhc:23:in `load'
        from C:/Ruby22-x64/bin/rhc:23:in `<main>'

I found same problem: https://groups.google.com/forum/#!topic/supmua/hPyTTamhTyc It's suggest to replace DL with Fiddle.

How I can get working rhc?

7
  • 12
    I can't and won't test it, but try installing net-ssh-2.9.3.beta1. This commit added support for fiddle.
    – cremno
    Mar 6, 2015 at 11:12
  • 1
    Nothing has ever worked smoothly with Ruby ever since I used it 3 years ago. Every single time some or the other error due to version problems. Open shift recommends installing latest! Extremely frustrating!
    – Jus12
    Jul 29, 2015 at 5:54
  • I can´t understand. It worked, thanks
    – Hinotori
    Oct 16, 2015 at 2:47
  • It did not work for me, trying with all suggested here; old versions from ruby, net-ssh, newer, update... but I still cannot make this setup work.
    – juagicre
    Nov 14, 2015 at 14:01
  • I found out that the latest rhc version 1.38.4 declares dependency to net-ssh <=2.9.2 so it doesn't want to run with net-ssh-2.9.3.beta1. I reverted to rhc version 1.37.1 which ran successfully using net-ssh-2.9.3.beta1. Nov 25, 2015 at 9:44

7 Answers 7

208

Updating net-ssh to 2.9.3.beta1, as cremno suggested in this comment, resolved my problem.

gem install net-ssh -v 2.9.3.beta1

Before that, I tried gem install net-ssh, but it didn't help.

8
  • 3
    I had the same issue. However, you need to GEM install 2.9.3beta1, not 2.5.3, so the command should be gem install net-ssh -v 2.9.3.beta1 Mar 9, 2015 at 23:40
  • I've trqed to update to 2.9.3.beta1, tried to 2.10.1.rc1. Nothing seems to help =(
    – dmigo
    Aug 15, 2015 at 11:09
  • 9
    The issue is with Ruby 2.2.2. Downgrade to Ruby to 2.1.6 and net-ssh to 2.9.2 Issue details in Github. Even if rhc installs with 2.9.3.beta1, at the time of ssh connection to the app, it won't work. It will complain something about: Could not parse PKey: no start line Sep 18, 2015 at 17:32
  • 2
    it didn't work for me :( C:\>rhc setup C:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in require': cannot load such file -- dl/import (LoadError) from C:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_req uire.rb:54:in require' ......... from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rhc-1.38.4/bin/rhc:20:in <t op (required)>' from C:/Ruby22-x64/bin/rhc:23:in load' from C:/Ruby22-x64/bin/rhc:23:in `<main>' Nov 12, 2015 at 10:23
  • 3
    This didn't work for me. I installed Ruby 1.9.3 and re-installed rhc, that worked.
    – yelmu
    Nov 26, 2015 at 20:05
49

I ran into this problem when I used the latest version of Ruby (currently 2.2.1) as stated on the OpenShift setup instructions. I fixed it by:

  1. Installing Ruby 1.9.3
  2. Re-running "gem install rhc"

After that, I was able to run "rhc setup" without any issue.

6
  • 4
    gem install net-ssh -v 2.9.3.beta1 works, no need to reinstalling ruby to older version Mar 14, 2015 at 23:27
  • as Hoto said, gem install net-ssh -v 2.9.3.beta1 works. don't revert to 1.9.3
    – ssi-anik
    Sep 7, 2015 at 7:20
  • 1
    net-ssh -v2.9.3beta1 will gives error when taking snapshots and tail Sep 12, 2015 at 4:56
  • Same issue here and I downgraded Ruby from 2.2 to 1.9.3 and it worked Nov 9, 2015 at 21:23
  • 5
    I confirm the solution of using ruby 1.9.3. I tried with the latest 2.2.x and it failed. I uninstalled it, installer 1.9.3, ran gem install rhc again then rhc setup again and things now work fine.
    – Chevdor
    Nov 19, 2015 at 10:17
17

If you are running Windows 10 Pro x64, try installing Ruby 2.1.8 (x64) with Git Version 2.7.0. This will surely allow you to run rhc setup as it did happened with me. Earlier I had a problem running & installing latest version of Ruby 2.2.4 (x64) but when I downgraded to ruby version 2.1.8 (x64) I was able to run rhc setup and configure OpenShift client toolson Windows. See the image for Ruby version I'm using - ruby 2.1.8p440 (2015-12-16 revision 53160) [x64-mingw32]

enter image description here

Read here for getting started to OpenShift client tools on windows.

2
  • This seems to work, but I do see $ rhc setup --> DL is deprecated, please use Fiddle when I run the setup.
    – zipzit
    Feb 24, 2016 at 22:11
  • This seems to be a fail. When I go to $ rhc setup I get down to the point where I type in my password, hit return, then the system just hangs there. No error message, no feedback, just no function. This whole RHC thing from OpenShift is terrible.
    – zipzit
    Feb 25, 2016 at 0:34
11

Use the RHC tested Ruby version instead of the latest. As of today it is 1.9.3-p194

2
  • how did you know the RHC tested ruby version ?
    – Samy Omar
    Nov 28, 2015 at 0:47
  • Downgrading to version 1.9.3-p194 worked for me. Thanks @reversiblean
    – blakroku
    Jul 11, 2016 at 12:12
1

Try using/installing a lower version of ruby after uninstalling the 2,2,0 because some windows version conflict with ruby version you are using. I tried 2.2.3 and then lowered to 2.2.0 and it worked for me.

1

I ran into this same error, and none of the solutions worked for me. In a last attempt, I installed the Ruby 1.9.3-p551 version and the rhc setup went smoothly. I use a Windows 10 machine.

0

I am running Windows 10 Pro x64. I installed Ruby 2.1.8 (x64) with Git Version 2.7.2. Rhc was installed successfully. However, "rhc snapshot save ..." command had problem with net-ssh. However, after restarting windows 10 the errors was gone.

Remember to try reboot your windows.

2
  • By the way, I also have to move ruby to C: (windows root drive) instead of D: drive (my software drive). OR the c: user drive. It was weird but it did matter.
    – hosais
    Mar 7, 2016 at 11:46
  • 1
    I finally realized it is because I am running pageant (putty key management). It will cause ”Creation of file mapping failed with error: 998 (Net::SSH::Exception)“. It was not about C drive or D drive or rebooting the computer. (Rebooting my computer will stop pageant service.
    – hosais
    Mar 21, 2016 at 17:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.