How to Install the OpenShift rhc Client Tools on Windows

We know a lot of our users prefer to use Microsoft Windows for their development and deployment environment. Today I’m going to show you how to install the rhc client tools on a Windows machine.

OpenShift is Red Hat’s free, Cloud Application Platform as a Service (PaaS). As an application platform in the cloud, OpenShift manages the stack so you can focus on your code. And best of all, OpenShift is free to use and try out.

Our free plan gives each user three gears allowing them to create three applications with 512mb of RAM and 1GB of disk space each. Want to add a database to your application? No problem. We have MongoDB, MySQL, and PostgreSQL. If you don’t have an account, sign up for OpenShift now, it’s free.

What are you waiting for? Let’s get started with using OpenShift on Windows.

Learn how to install the OpenShift rhc client tools on Windows in this short screencast

Step 1: Create an account

Before continuing you’ll need to have a validated Openshift account. The good news is that we have lots of plans to choose from so be sure to visit our Pricing Page and pick the best plan that fits your needs.

Step 2: Ensure you have the proper permissions

You must have access and permission to install new software on your system. Depending on how your system is configured, you may need to disable User Account Control (UAC) or have the permission to accept new software installation.

Step 3: Install the Ruby environment on your system

The OpenShift client tools are written in the Ruby programming language. In order to execute and use the commands, you must have the appropriate runtime environment for your operating system. We suggest that you use the RubyInstaller from rubyinstaller.org in order to ensure you have the correct packages to interact with OpenShift.

Point your browser to rubyinstall.org and click the red download button on the left side of the screen.

Download the latest version and select Run from the dialog choices.

Once the installation has started, you will be requested to accept the license agreement that is presented to you. Review the license and click accept if you agree to the stated terms.

We will be interacting with OpenShift via the command line during this blog so ensure that you select ‘Add Ruby executables to your PATH’. This will ensure that you can access the ruby and gem commands from your windows command prompt.

Step 4: Install the Git revision control software on your system

In order to deploy and push your application code up to your OpenShift servers, you will need to have the Git revision control system installed and accessible on your system. To install this software, download the latest package from http://msysgit.github.com/ and follow the instructions.

As we did with Ruby above, we want Git to be available to us on the command line. Select ‘Run Git from the Windows Command Prompt’ and click next.

On the next screen, make sure that ‘Checkout Windows-style, commit Unix-style line endings’ is checked and click next.

Step 5: Install the RHC command line tools

Now that we have Ruby and Git installed, we are ready to start the installation of the OpenShift command line tools. In order to do this, open up a command prompt by clicking the windows logo and type in cmd.

You should be sitting at a command prompt at this point. All we need to do now is issue the following command:

gem install rhc

This will download and install the client tools as well as any required dependencies for the package.

Step 6: Use the RHC command line tools

Now that you have the client tools installed, you can begin using them by using the following command to list all of your existing applications:

rhc domain show

If this is the first time you have used the RHC tools on your machine, it will take you through a guided setup to create your SSH key and then upload it to the server. Make sure that you have already signed up for an OpenShift account and created a namespace before using the rhc domain show command.

Pro-Tip:

if you ever get stuck just add -h to the end of the command to display some help. For instance:

 rhc create-app -h

That’s all there is to it to get up and running using the OpenShift client tools on Microsoft Windows. See you on the Cloud!

Categories
OpenShift Container Platform, OpenShift Online, OpenShift Origin
Tags
, ,
  • Hey The gem install rhc is not working it is giving and Certificate error is there an manual to install that like drag and drop method

  • zipzit

    Very odd. `gem install rhc` generates `Successfully installed rhc-1.35.3` .. 1 gem installed. from that moment on,any `rhc` command generates a whole bunch of errors. Something is obviously wrong. Where is the best place to get help?

    • spurtell

      Please submit this issue to https://help.openshift.com/hc/en-us/requests/new (and reference this blog comment) – some information about your OS version and Ruby version would also be helpful.

    • ramsri

      I got a bunch of errors starting with LoadError kerner_require.rb:54 Then I tried the command gem install net-ssh -v 2.9.3.beta1
      After that with rhc status and then rhc domain show. Things were fine with these commands now.

  • Partyk1d24

    Tried this…

    gem install rhc

    ….

    Done installing documentation for open4, httpclient, highline, commander, archive-tar-minitar, net-ssh, net-ssh-gateway, net-ssh-multi, net-scp, rhc after 27 seconds

    10 gems installed

    $ rhc setup

    -bash: rhc: command not found

    $ rhc -v

    -bash: rhc: command not found

    $ ruby -v

    ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-cygwin]

    • Thai

      I have the exact same issue.
      Edit: I use cygwin and the rhc is in ~/bin which needs to be in the PATH.