Installing OpenShift RHC Client Tools
The OpenShift Client tools known as
rhc are built and packaged using the Ruby programming language. OpenShift integrates with the Git version control system to provide powerful, decentralized version control for your application source code.
rhc can be run on any operating system with Ruby 1.8.7 or higher if you have the requisite user permissions to install programs. Instructions for specific operating systems are provided below. It is assumed that you are running the commands from a command line window, such as Command Prompt, or Terminal. If you are using Ruby Version Manager (rvm) see the instructions below.
apt-get command line package manager to install Ruby and Git before you install the OpenShift command line tools. Run:
$ sudo apt-get install ruby-full rubygems git-core
After you install both Ruby and Git, verify they can be accessed via the command line:
$ ruby -e 'puts "Welcome to Ruby"' Welcome to Ruby $ git --version git version 126.96.36.199
If either program is not available from the command line, please add them to your
With Ruby and Git correctly installed, you can now use the RubyGems package manager to install the OpenShift client tools. From a command line, run:
$ sudo gem install rhc
After the OpenShift client tools are installed, run:
$ rhc setup
The OpenShift interactive setup wizard displays and prompts you to complete the rest of the process. If you cannot run the OpenShift client tools at this point, please contact us on IRC or post in our forums for more assistance.
root@ubuntu:~# apt-get install ruby-full rubygems git-core Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: git git-man liberror-perl libreadline5 libruby1.8 ri1.8 ruby1.8 ruby1.8-dev ruby1.8-full Suggested packages: git-daemon-run git-daemon-sysvinit git-doc git-el git-arch git-cvs git-svn git-email git-gui gitk gitweb ruby1.8-examples Recommended packages: rsync libtcltk-ruby1.8 The following NEW packages will be installed: git git-core git-man liberror-perl libreadline5 libruby1.8 ri1.8 ruby-full ruby1.8 ruby1.8-dev ruby1.8-full rubygems 0 upgraded, 12 newly installed, 0 to remove and 264 not upgraded. Need to get 9497 kB of archives. After this operation, 33.5 MB of additional disk space will be used. Do you want to continue [Y/n]? y Get:1 http://ports.ubuntu.com/ubuntu-ports/ precise/main libreadline5 armhf 5.2-11 [102 kB] Get:2 http://ports.ubuntu.com/ubuntu-ports/ precise/main liberror-perl all 0.17-1 [23.8 kB] Get:3 http://ports.ubuntu.com/ubuntu-ports/ precise/main git-man all 1:188.8.131.52-1 [630 kB] Get:4 http://ports.ubuntu.com/ubuntu-ports/ precise/main git armhf 1:184.108.40.206-1 [4898 kB] Get:5 http://ports.ubuntu.com/ubuntu-ports/ precise/main git-core all 1:220.127.116.11-1 [1384 B] Get:6 http://ports.ubuntu.com/ubuntu-ports/ precise-security/main libruby1.8 armhf 18.104.22.1682-2ubuntu1.4 [1644 kB] Get:7 http://ports.ubuntu.com/ubuntu-ports/ precise-security/main ruby1.8 armhf 22.214.171.1242-2ubuntu1.4 [33.7 kB] Get:8 http://ports.ubuntu.com/ubuntu-ports/ precise-security/universe ri1.8 all 126.96.36.1992-2ubuntu1.4 [1162 kB] Get:9 http://ports.ubuntu.com/ubuntu-ports/ precise-security/main ruby1.8-dev armhf 188.8.131.522-2ubuntu1.4 [544 kB] Get:10 http://ports.ubuntu.com/ubuntu-ports/ precise-security/universe ruby1.8-full all 184.108.40.2062-2ubuntu1.4 [2592 B] Get:11 http://ports.ubuntu.com/ubuntu-ports/ precise/universe ruby-full all 4.8 [4574 B] Get:12 http://ports.ubuntu.com/ubuntu-ports/ precise-security/main rubygems all 1.8.15-1ubuntu0.1 [449 kB] Fetched 9497 kB in 3min 5s (51.2 kB/s) Selecting previously unselected package libreadline5. (Reading database ... 90876 files and directories currently installed.) Unpacking libreadline5 (from .../libreadline5_5.2-11_armhf.deb) ... Selecting previously unselected package liberror-perl. Unpacking liberror-perl (from .../liberror-perl_0.17-1_all.deb) ... Selecting previously unselected package git-man. Unpacking git-man (from .../git-man_1%3a220.127.116.11-1_all.deb) ... Selecting previously unselected package git. Unpacking git (from .../git_1%3a18.104.22.168-1_armhf.deb) ... Selecting previously unselected package git-core. Unpacking git-core (from .../git-core_1%3a22.214.171.124-1_all.deb) ... Selecting previously unselected package libruby1.8. Unpacking libruby1.8 (from .../libruby1.8_126.96.36.1992-2ubuntu1.4_armhf.deb) ... Selecting previously unselected package ruby1.8. Unpacking ruby1.8 (from .../ruby1.8_188.8.131.522-2ubuntu1.4_armhf.deb) ... Selecting previously unselected package ri1.8. Unpacking ri1.8 (from .../ri1.8_184.108.40.2062-2ubuntu1.4_all.deb) ... Selecting previously unselected package ruby1.8-dev. Unpacking ruby1.8-dev (from .../ruby1.8-dev_220.127.116.112-2ubuntu1.4_armhf.deb) ... Selecting previously unselected package ruby1.8-full. Unpacking ruby1.8-full (from .../ruby1.8-full_18.104.22.1682-2ubuntu1.4_all.deb) ... Selecting previously unselected package ruby-full. Unpacking ruby-full (from .../archives/ruby-full_4.8_all.deb) ... Selecting previously unselected package rubygems. Unpacking rubygems (from .../rubygems_1.8.15-1ubuntu0.1_all.deb) ... Setting up libreadline5 (5.2-11) ... Setting up liberror-perl (0.17-1) ... Setting up git-man (1:22.214.171.124-1) ... Setting up git (1:126.96.36.199-1) ... Setting up git-core (1:188.8.131.52-1) ... Setting up libruby1.8 (184.108.40.2062-2ubuntu1.4) ... Setting up ruby1.8 (220.127.116.112-2ubuntu1.4) ... update-alternatives: using /usr/bin/ruby1.8 to provide /usr/bin/ruby (ruby) in auto mode. Setting up ri1.8 (18.104.22.1682-2ubuntu1.4) ... Setting up ruby1.8-dev (22.214.171.1242-2ubuntu1.4) ... Setting up ruby1.8-full (126.96.36.1992-2ubuntu1.4) ... Setting up ruby-full (4.8) ... Setting up rubygems (1.8.15-1ubuntu0.1) ... Processing triggers for libc-bin ... ldconfig deferred processing now taking place root@ubuntu:~# ruby -e 'puts "Welcome to Ruby"' Welcome to Ruby root@ubuntu:~# git --version git version 188.8.131.52 root@ubuntu:~# sudo gem install rhc Fetching: net-ssh-2.8.0.gem (100%) Fetching: net-scp-1.1.2.gem (100%) Fetching: net-ssh-gateway-1.2.0.gem (100%) Fetching: net-ssh-multi-1.2.0.gem (100%) Fetching: archive-tar-minitar-0.5.2.gem (100%) Fetching: highline-1.6.20.gem (100%) Fetching: commander-4.1.6.gem (100%) Fetching: httpclient-184.108.40.206.gem (100%) Fetching: open4-1.3.3.gem (100%) Fetching: rhc-1.21.3.gem (100%) =========================================================================== If this is your first time installing the RHC tools, please run 'rhc setup' =========================================================================== Successfully installed net-ssh-2.8.0 Successfully installed net-scp-1.1.2 Successfully installed net-ssh-gateway-1.2.0 Successfully installed net-ssh-multi-1.2.0 Successfully installed archive-tar-minitar-0.5.2 Successfully installed highline-1.6.20 Successfully installed commander-4.1.6 Successfully installed httpclient-220.127.116.11 Successfully installed open4-1.3.3 Successfully installed rhc-1.21.3 10 gems installed Installing ri documentation for net-ssh-2.8.0... Installing ri documentation for net-scp-1.1.2... Installing ri documentation for net-ssh-gateway-1.2.0... Installing ri documentation for net-ssh-multi-1.2.0... Installing ri documentation for archive-tar-minitar-0.5.2... Installing ri documentation for highline-1.6.20... Installing ri documentation for commander-4.1.6... Installing ri documentation for httpclient-18.104.22.168... RDoc failure in lib/httpclient.rb at or around line 408 column 16 Before reporting this, could you check that the file you're documenting compiles cleanly--RDoc is not a full Ruby parser, and gets confused easily if fed invalid programs. The internal error was: ERROR: While generating documentation for httpclient-22.214.171.124 ... MESSAGE: undefined method `name' for #<RubyToken::TkLPAREN:0xb420bc98> ... RDOC args: --ri --op /var/lib/gems/1.8/doc/httpclient-126.96.36.199/ri lib --title httpclient-188.8.131.52 Documentation --quiet root@ubuntu:~# rhc setup OpenShift Client Tools (RHC) Setup Wizard This wizard will help you upload your SSH keys, set your application namespace, and check that other programs like Git are properly installed. Login to openshift.redhat.com:(firstname.lastname@example.org) Password: ********** OpenShift can create and store a token on disk which allows to you to access the server without using your password. The key is stored in your home directory and should be kept secret. You can delete the key at any time by running 'rhc logout'. Generate a token now? (yes|no) yes Generating an authorization token for this client ... lasts about 1 month Saving configuration to /root/.openshift/express.conf ... done No SSH keys were found. We will generate a pair of keys for you. Created: /root/.ssh/id_rsa.pub Your public SSH key must be uploaded to the OpenShift server to access code. Upload now? (yes|no) yes Since you do not have any keys associated with your OpenShift account, your new key will be uploaded as the 'default' key. Uploading key 'default' ... done Checking for git ... found git version 184.108.40.206 Checking common problems .. done Checking for a domain ... none Applications are grouped into domains - each domain has a unique name (called a namespace) that becomes part of your public application URL. You may create your first domain here or leave it blank and use 'rhc create-domain' later. You will not be able to create an application without completing this step. Please enter a namespace (letters and numbers only) |<none>|: pcduino Your domain 'pcduino' has been successfully created Checking for applications ... none Run 'rhc create-app' to create your first application. Do-It-Yourself 0.1 rhc create-app <app name> diy-0.1 JBoss Application Server 7 rhc create-app <app name> jbossas-7 JBoss Data Virtualization 6 rhc create-app <app name> jboss-dv-6.0.0 JBoss Enterprise Application Platform rhc create-app <app name> jbosseap-6 6 Jenkins Server rhc create-app <app name> jenkins-1 Node.js 0.10 rhc create-app <app name> nodejs-0.10 Node.js 0.6 rhc create-app <app name> nodejs-0.6 PHP 5.3 rhc create-app <app name> php-5.3 PHP 5.3 with Zend Server 5.6 rhc create-app <app name> zend-5.6 PHP 5.4 rhc create-app <app name> php-5.4 PHP 5.4 with Zend Server 6.1 rhc create-app <app name> zend-6.1 Perl 5.10 rhc create-app <app name> perl-5.10 Python 2.6 rhc create-app <app name> python-2.6 Python 2.7 rhc create-app <app name> python-2.7 Python 3.3 rhc create-app <app name> python-3.3 Ruby 1.8 rhc create-app <app name> ruby-1.8 Ruby 1.9 rhc create-app <app name> ruby-1.9 Tomcat 6 (JBoss EWS 1.0) rhc create-app <app name> jbossews-1.0 Tomcat 7 (JBoss EWS 2.0) rhc create-app <app name> jbossews-2.0 Vert.x 2.1 rhc create-app <app name> jboss-vertx-2.1 You are using 0 of 3 total gears The following gear sizes are available to you: small Your client tools are now configured. root@ubuntu:~#