Here’s the way I execute rake command in OpenShift server in.
Environment
My OpenShift Server is using ruby 2.0.
Procedure
Login to your OpenShift server. I logged in with rhc ssh
(reference: OoenShift: ssh login).
Then, setup enviroments and execute your rake task.
1 2 3 4 |
[app-domain.rhcloud.com xxxxx]> cd $OPENSHIFT_REPO_DIR [app-domain.rhcloud.com repo]> source ${OPENSHIFT_CARTRIDGE_SDK_BASH} [app-domain.rhcloud.com repo]> source ${OPENSHIFT_RUBY_DIR}/lib/ruby_context [app-domain.rhcloud.com repo]> ruby_with_nodejs_context "bundle exec rake your:command RAILS_ENV=${RAILS_ENV:-production}" |
Actually, I’m not sure that source ${OPENSHIFT_CARTRIDGE_SDK_BASH}
is really needed.