Maintaining the database can easily be done through your browser by using the phpMyAdmin link and the username+password on your application’s dashboard page.
If you are getting server errors on your deployed application and not on your copy running locally, you may need to view the OpenShift server logs:
rhc ssh -a MySinatraApp
cd app-root/logs
vim ruby.log
|| mysql.log
|| production.log
If your OpenShift application is experiencing gem or dependency issues, first run bundle install --without production
in your code’s local repo. Then create an empty file by running touch ./.openshift/markers/force_clean_build
. Git add, commit and push the changes. Pushing your code with a file named force_clean_build in the markers directory forces OpenShift to run a clean bundle install on your application for every push. Running rhc env set BUNDLE_WITHOUT='development test' -a MySinatraApp
before pushing a force clean will prevent OpenShift from installing unnecessary gems. You only need to set the environment variable once - it will be remembered by the app.
If you find any issues you would like to raise with my Sinatra-MySQL QuickStart, please submit one on GitHub! It is intended to just work and I want to try to make it work for everyone, so input is appreciated!
OpenShift also provides valuable information about their Ruby application hosting service that is sure to come in handy!
Did this guide help you get your app up and running? Did it just leave you frustrated and confused? Leave a comment with your experience down below!
Gandhi Anderson BLOG
ruby sinatra