Sponsored by Gluten Free Waffles and Sliced Bananas

Tuesday, December 11, 2012

Deploy an Existing Git Repository to OpenShift

5:46 PM Posted by Tyson Nero , No comments
Deployment to production can sometimes be a tricky matter, and it seems a lot of people have questions trying to figure out how to deploy and existing Git repo to an OpenShift application.

I followed this article:
https://openshift.redhat.com/community/kb/kb-e1006-sync-new-git-repo-with-your-own-existing-git-repo

Here were my steps of failure and success:

  1. Add my OpenShift Git repository as a remote in an existing Git repository. Note: my origin repo is hosted on GitHub.

    git remote add openshift ssh-url
  2. Pull and merge from OpenShift

    FAIL!

    OpenShift returned with the following error
    Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
    fatal: The remote end hung up unexpectedly
    Apparently something was wrong with how my SSH keys were configured if at all.
  3. Run "rhc setup" within my Git directory. This will generate and configure SSH keys for communication with OpenShift.
  4. Pull and merge again from OpenShift
    I.e. git merge openshift/master -s recursive -X ours
  5. Commit changes and push to Openshift

Friday, December 7, 2012

Fixing "gem: command not found" after installing RVM (Ubuntu)

6:51 PM Posted by Tyson Nero , , No comments
After installing RVM and Ruby on my Ubuntu 10.04 machine, I installed Compass via "gem install compass". When I tried to run Compass from the command line, I received "compass: command not found".

It seemed my install of Ruby was not correctly added to the path. I quickly found some fixes via Google that involved modifying a couple lines of the .bashrc file. However, it turns out that the simplest fix would be to add the following the end of the .bashrc file...

PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting

Hope this helps.

------------

UPDATE

It seems I also had to set the path directly to my Ruby bin directory:
PATH=$PATH:$HOME/.rvm/gems/ruby-1.9.3-p327/bin