After running the command railsdemo folder will get created in your directory. Run the command shown below. This will generate rails code in the railsdemo folder.It will ask you whether you want to override, say yes.
rails new railsdemo
Next run commands shown below
rails generate controller home index
Add the following route to config/routes.rb:
root :to => "home#index"
Generate Post entity with fields as shown below
rails generate scaffold Post name:string title:string content:text
Add Database support by uncommenting following lines from .openshift/action_hooks/deploy script