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?

Jay Wick
  • 12,325
  • 10
  • 54
  • 78
Vladimir Balandin
  • 3,854
  • 3
  • 17
  • 15
  • 12
    I can't and won't test it, but try installing [net-ssh-2.9.3.beta1](https://rubygems.org/gems/net-ssh/versions/2.9.3.beta1). [This commit](https://github.com/net-ssh/net-ssh/commit/33f8a46d2891ee5de4c55e1bf8b1b04d8d8c5133) added support for fiddle. – cremno Mar 06 '15 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 '15 at 05:54
  • I can´t understand. It worked, thanks – Hinotori Oct 16 '15 at 02: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 '15 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. – Aleksey Korolev Nov 25 '15 at 09:44
  • **dl has been removed from ruby**... someone who knows ruby is requested to **fork rhc and use fiddle** instead.. https://github.com/ruby/ruby/blob/v2_2_0/NEWS#L148-L149 – earthdan Mar 11 '16 at 06:38
  • Possible duplicate of [Openshift and net-ssh incompatibility? (2.9.3-beta1 vs 2.9.2)](http://stackoverflow.com/questions/31906673/openshift-and-net-ssh-incompatibility-2-9-3-beta1-vs-2-9-2) – earthdan Mar 11 '16 at 08:27

7 Answers7

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.

Community
  • 1
  • 1
Vladimir Balandin
  • 3,854
  • 3
  • 17
  • 15
  • 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 – Cryophallion Mar 09 '15 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 '15 at 11:09
  • It didn't work for me as well. Eventually I used findstr under the ruby gems directory and manually changed all dl usages to fiddle. For _Ruby22-x64/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/pageant.rb_ I changed `dl` to `fiddle` in lines 1, 6 & 7, I also changed `Dl` to `Fiddle` in lines 40, 42, 44, 164, 176, 180 & 184. I also use Highline so I had to do the same in file _Ruby22-x64\lib\ruby\gems\2.2.0\gems\highline-1.6.19\lib\highline\system_extensions.rb_, lines 76 & 79. – gneri Aug 22 '15 at 16:56
  • 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](https://github.com/openshift/rhc/issues/682). 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 – Camilo Crespo Sep 18 '15 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 `' from C:/Ruby22-x64/bin/rhc:23:in `load' from C:/Ruby22-x64/bin/rhc:23:in `
    '
    – Ayed Mohamed Amine Nov 12 '15 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 '15 at 20:05
  • I had installed `2.2.4` version but the above answer doesn't work for that. Then i installed `2.1.6` version and above answer worked for that. – Ankur Raiyani Mar 09 '16 at 10:18
  • it looks this problem is manifestation of hardcore requirement on net-ssh version <= 2.9.0
    net-ssh 3.* have solved this problem... we just need to use net-ssh with rhc see my answer http://stackoverflow.com/a/35935384/2382629
    – earthdan Mar 11 '16 at 08:25
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.

Peter L
  • 491
  • 3
  • 4
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.

rbashish
  • 2,073
  • 2
  • 24
  • 35
  • This seems to work, but I do see `$ rhc setup` --> `DL is deprecated, please use Fiddle` when I run the setup. – zipzit Feb 24 '16 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 '16 at 00:34
11

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

Gayan Weerakutti
  • 11,904
  • 2
  • 71
  • 68
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.

user1419261
  • 829
  • 8
  • 5
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.

Divya Mary
  • 71
  • 1
  • 4
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.

hosais
  • 164
  • 1
  • 1
  • 10
  • 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 07 '16 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 '16 at 17:14