Part 1: Setting up Refinery on Heroku
These tutorials are built using Rails 3.
If you didn't know already, Refinery is a CMS that is built on the Ruby on Rails framework and Heroku is a service that allows you to host Ruby applications/websites that are built using Rails, Sinatra, or anything that is built using Rack. This is going to be a 2 part series that will be broken up into:
I will be using the generic term APP_NAME through out this tutorial. Feel free the name it whatever you want, but keep it lowercase.
Creating the Application
Typing this line of code into your terminal will create a folder with the title of APP_NAME in your current directory and populate it with all the required files. By putting --heroku at the end of the line, it will also attempt to create a heroku app with the same name as APP_NAME.
refinerycms APP_NAME --heroku
Configure
First, change the directory to the you just created. The line after that is optional if you wish to change the name of your heroku app. Next, run a bundle install to install all the gems required to run refinery on your local machine. Then, run a rake db:setup to setup your database.
cd APP_NAME
heroku rename APP_NAME
bundle install
rake db:setup
Testing it Locally
In terminal type, rails server to get in running locally. Using the browser of your choice, go to http://localhost:3000
rails server
Setting up AWS
Because you are using Heroku, I'm also going to assume you'll be using Amazon Web Services (AWS) to host you images/files since Heroku won't allow you to write files to their database. You'll have to sign up for an account and create a bucket. Your S3 key and secret can be found here. Once you have a bucket:
heroku config:add S3_BUCKET=BUCKET_NAME
heroku config:add S3_KEY=S3_KEY
heroku config:add S3_SECRET=S3_SECRET
In your Gemfile, you'll have to uncomment this line:
gem 'aws-s3', :require => 'aws/s3'
Testing is locally with AWS images
env S3_BUCKET=BUCKET_NAME rails server
Working with a Team
If you wish to add contributors to your Heroku app:
heroku sharing:add EMAIL_ADDRESS
Or transfer the ownership of the app:
heroku sharing:transfer EMAIL_ADDRESS
