Bug 1201844

Summary: Can not run rhc setup on windows 8 64bit with ruby 2.2
Product: OpenShift Online Reporter: Corey Daley <cdaley>
Component: ocAssignee: Fabiano Franz <ffranz>
Status: CLOSED WONTFIX QA Contact: libra bugs <libra-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 2.xCC: abawabaw01, dustinh17, ffranz, jokerman, marc.albert.ma, mmccomas, nbhirud, psenough, rhowe, rthrashe
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-10-19 19:11:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Corey Daley 2015-03-13 15:41:15 UTC
Description of problem:
when using RHC through command prompt after installing ruby and setting up git I get the following error everytime I try to run rhc

Version-Release number of selected component (if applicable):


How reproducible:
very

Steps to Reproduce:
1. install ruby 2.2 on windows 8 64 bit
2.run rhc setup
3.

Actual results:
C:\Windows\system32>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/net-ssh-2.9.2/lib/net/ssh/au
thentication/pageant.rb:1:in `<top (required)>'
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/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/net-ssh-2.9.2/lib/net/ssh/au
thentication/agent/socket.rb:5:in `<top (required)>'
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/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/net-ssh-2.9.2/lib/net/ssh/au
thentication/agent.rb:22:in `<top (required)>'
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/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/net-ssh-2.9.2/lib/net/ssh/au
thentication/key_manager.rb:4:in `<top (required)>'
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/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/net-ssh-2.9.2/lib/net/ssh/au
thentication/session.rb:4:in `<top (required)>'
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/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/net-ssh-2.9.2/lib/net/ssh.rb
:11:in `<top (required)>'
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/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.35.1/lib/rhc/ssh_helpe
rs.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/site_ruby/2.2.0/rubygems/core_ext/kernel_req
uire.rb:54:in `require'
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.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/site_ruby/2.2.0/rubygems/core_ext/kernel_req
uire.rb:54:in `require'
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.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 `<t
op (required)>'
from C:/Ruby22-x64/bin/rhc:23:in `load'
from C:/Ruby22-x64/bin/rhc:23:in `<main>'

Expected results:
it should run the setup

Additional info:
To reproduce I am using a windows 8 64 bit system going tried using git at first and then windows command prompt as well but no luck, I installed rhc, and it seems like it ran fine. But when attempting to run rhc setup, it throws this error into the console. I am using the latest version of ruby, and latest version of git for windows
I expected it to setup my host as it was portrayed in the tutorial but instead I received this error on setup.

Comment 3 Nikhil Bhirud 2015-12-03 08:47:49 UTC
I get the same error. Could you please share a solution for this?

Comment 6 Filipe Cruz 2015-12-22 22:25:47 UTC
same issue. stackoverflow says to downgrade to older ruby or install specific net-ssh version. but i would rather see this working with latest ruby. :S

Comment 7 Rory Thrasher 2016-04-22 22:23:45 UTC
Sorry for the long wait.  Its been very interesting trying to figure out these dependency issues for RHC.  It seems to be impossible to provide a pre-built rhc gem (like the one found at rubygems.org) that will support Ruby 1.8.7 for our RHEL customers and also support the newer versions of Ruby.

So instead of downloading the gem from rubygems.org like before, customers wanting to use newer versions of RHC should instead build it from source.  We've added conditional code that checks the Ruby version at build time and will install the correct dependencies, see <https://github.com/openshift/rhc/pull/750>.  This has just been changed, so documentation has yet to be updated, but the basic instructions are as follows.


1. Install the desired ruby version from <http://rubyinstaller.org/> and git for windows from <https://git-for-windows.github.io/>.

2. In the command prompt, navigate to where you would like to install the rhc source and `git clone https://github.com/openshift/rhc`, then cd into the newly downloaded rhc directory.

3. Build the gem from source with `gem build rhc.gemspec`.  This will build the gem using the current version of ruby to determine dependencies, and will create a file named rhc-1.38.4.gem.  There will likely be a few warnings when building, but it should say "Successfully built RubyGem" near the end of the output.

4. Install the local gem with `gem install rhc-1.38.4.gem`.  This will download all the dependencies and set up RHC.  You may be required to add RHC to your path, but I didn't have to in my testing.

5. Run `rhc setup` and then continue to rhc as before.

Comment 8 Marc Albert 2016-06-21 23:36:11 UTC
It does not work. I have the same error.

3. Build the gem from source with `gem build rhc.gemspec`.  This will build the gem using the current version of ruby to determine dependencies, and will create a file named rhc-1.38.4.gem.  There will likely be a few warnings when building, but it should say "Successfully built RubyGem" near the end of the output.


C:\client tool\rhc>gem build rhc.gemspec
WARNING:  licenses is empty, but is recommended.  Use a license identifier from
http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
WARNING:  open-ended dependency on net-scp (>= 1.1.2) is not recommended
  if net-scp is semantically versioned, use:
    add_runtime_dependency 'net-scp', '~> 1.1', '>= 1.1.2'
WARNING:  open-ended dependency on net-ssh-multi (>= 1.2.0) is not recommended
  if net-ssh-multi is semantically versioned, use:
    add_runtime_dependency 'net-ssh-multi', '~> 1.2', '>= 1.2.0'
WARNING:  open-ended dependency on archive-tar-minitar (>= 0) is not recommended

  if archive-tar-minitar is semantically versioned, use:
    add_runtime_dependency 'archive-tar-minitar', '~> 0'
WARNING:  pessimistic dependency on highline (~> 1.6.11) may be overly strict
  if highline is semantically versioned, use:
    add_runtime_dependency 'highline', '~> 1.6', '>= 1.6.11'
WARNING:  open-ended dependency on open4 (>= 0) is not recommended
  if open4 is semantically versioned, use:
    add_runtime_dependency 'open4', '~> 0'
WARNING:  open-ended dependency on rake (>= 0.8.7, development) is not recommend
ed
  if rake is semantically versioned, use:
    add_development_dependency 'rake', '~> 0.8', '>= 0.8.7'
WARNING:  open-ended dependency on thor (>= 0, development) is not recommended
  if thor is semantically versioned, use:
    add_development_dependency 'thor', '~> 0'
WARNING:  See http://guides.rubygems.org/specification-reference/ for help
  Successfully built RubyGem
  Name: rhc
  Version: 1.38.4
  File: rhc-1.38.4.gem





4. Install the local gem with `gem install rhc-1.38.4.gem`.  This will download all the dependencies and set up RHC.  You may be required to add RHC to your path, but I didn't have to in my testing

C:\client tool\rhc>gem install rhc-1.38.4.gem
Fetching: httpclient-2.6.0.1.gem (100%)
Successfully installed httpclient-2.6.0.1
===========================================================================

If this is your first time installing the RHC tools, please run 'rhc setup'

===========================================================================
Successfully installed rhc-1.38.4
Parsing documentation for httpclient-2.6.0.1
Installing ri documentation for httpclient-2.6.0.1
Parsing documentation for rhc-1.38.4
Done installing documentation for httpclient, rhc after 8 seconds
2 gems installed



5. Run `rhc setup` and then continue to rhc as before.

C:\client tool\rhc>rhc setup
C:/Ruby23/lib/ruby/gems/2.3.0/gems/commander-4.2.1/lib/commander/user_interactio
n.rb:328: warning: constant ::TimeoutError is deprecated
C:/Ruby23/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': ca
nnot 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/authen
tication/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/authen
tication/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/authen
tication/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/authen
tication/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/authen
tication/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.r
b: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:i
n `<module:RHC>'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/rhc-1.38.4/lib/rhc/wizard.rb:6:i
n `<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/acco
unt.rb:2:in `<module:Commands>'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/rhc-1.38.4/lib/rhc/commands/acco
unt.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:1
89:in `block in load'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/rhc-1.38.4/lib/rhc/commands.rb:1
88:in `each'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/rhc-1.38.4/lib/rhc/commands.rb:1
88: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>'

Comment 10 Marc Albert 2016-06-22 21:38:57 UTC
I just found a solution for this problem. I suggest you to unistall ruby and git and install again both with the corresponding versions. The problem in my case it was because git version had an old version.

UNINSTALL PROGRAMS:
-------------------

 - Uninstall git from Control Panel of Windows.
 - Uninstall ruby from Control Panel of Windows.
 
 On Linux:
 - Uninstall rhc:
       $ sudo gem uninstall rhc
       $ sudo gem uninstall httpclient
       
 On Windows:
 - Uninstall rhc:
       $ gem uninstall rhc
       $ gem uninstall httpclient


INSTALL PROGRAMS:
-------------------
 Step 1: Install Ruby with RubyInstaller (from 1.9.3 to 2.0.0 versions)
The Client Tools are known to work well with Ruby versions 1.9.3 and 2.0.0 on Windows, based on the community feedback. We recommend downloading and installing one of those versions.

 Step 2: Install Git version control
Download and install the latest version of Git for Windows.


 Step 3: Install the rhc
$ sudo gem install rhc
$ rhc setup


and ready!