#Bluemix Instructions
- Install cloudfoundry cli
rails new MY_APP_NAME -T
- Add
rails_12factor
gem to gemfile for logging purposes touch manifest.yml
to 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 Rails
runtime towards the bottom - Choose your app name and route and then click
create
- Click
add a service
- Choose
ElephantSQL
- Rename the service name to
elephant
and clickcreate
- Update your
manifest.yml
to 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:migrate
to create your dbs and the schema - Open
config/database.yml
and 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
?