#Bluemix Instructions
- Install cloudfoundry cli
rails new MY_APP_NAME -T- Add
rails_12factorgem to gemfile for logging purposes touch manifest.ymlto create the manifest file in your root directory, this will store your Bluemix App config- Log in to Bluemix
- Click
Create an app - Choose
Ruby on Railsruntime towards the bottom - Choose your app name and route and then click
create - Click
add a service - Choose
ElephantSQL - Rename the service name to
elephantand clickcreate - Update your
manifest.ymlto look similar to this:
applications:
- name: APP_NAME
memory: 512M
instances: 1
host: HOST_NAME (usually same as APP_NAME)
domain: mybluemix.net
path: .
services:
- elephant
- In your console run
rake db:create db:migrateto create your dbs and the schema - Open
config/database.ymland change your Production settings to look similar to this:
production:
<% if ENV['VCAP_SERVICES'] %>
<% services = JSON.parse(ENV['VCAP_SERVICES'])
postgres = services["elephantsql"]
credentials = postgres.first["credentials"] %>
url: <%= credentials["uri"] %>
<% else %>
<<: *default
database: db/production.sqlite3
<% end %>
- You should now be ready to push to Bluemix
- Run
cf push -c "rake db:migrate"(you may be asked to log in and choose a target org and space)
Is there a way you can access
rails console?