Monday 2 May 2016

Openshift rake and Gemfile error

I have an application published in Openshift online.

Openshift works really nice, but there are some tricks you need to know to make it work as it should

  1. rake needs to be set up to '~> 0.9.6' for it to work (is the one in the environment)
  2. rack has to be '1.5.2'

I could leave with it, but a recent deployment was failing after updating the database for no reason at all during the migration (a migration I had tested locally).

I started looking around the Internet to fix the error, doing a rake db:reset, my application is in the final steps but it is not ready yet so I don't mind deleting the databse, and I discovered  that I could in fact update rake

How:
rhc ssh application
cd  app-roo/runtime/repo
gem update rake


So I updated my Gemfile with the new rake, commited and pushed

It failed....

My migration was not set up properly, I was using a change_column_default and from: and to: were not working. So I fixed it, and now I have a rake that is updated...

But I couldn't access the console...

I found the solution and posted here:
http://stackoverflow.com/questions/27388389/rails-console-doesnt-work-openshift/36978165#36978165

A change in the Gemfile and a couple of gem installs were needed.