Skip to content

Instantly share code, notes, and snippets.

@Nosfheratu
Last active December 21, 2015 23:38
Show Gist options
  • Save Nosfheratu/6383179 to your computer and use it in GitHub Desktop.
Save Nosfheratu/6383179 to your computer and use it in GitHub Desktop.
This is a step-by-step guide to install and deploy a Refinery CMS application on Heroku
==Configuration==
Ubuntu 12.04 LTS, precise
ruby 2.0.0p0 (2013-02-24 revision 39474) [i686-linux]
Rails 3.2.13
--Prerequisites
***I have a Vagrant for my development environment (avoid this, this is transparent for you...)
You must to have installed the following:
Ruby – 1.9.3, 2.0.0, Rubinius, and JRuby are all acceptable
RubyGems – Recommended that you have the latest version installed
Database – SQLite3 (default), MySQL, or PostgreSQL
ImageMagick – Recommended that you have the latest version installed
(read http://refinerycms.com/guides/installation-prerequisites for more information)
--Instructions
I followed next guide: http://refinerycms.com/guides/heroku#creating-a-new-refinery-application-on-heroku
1. Install refinery gem
sudo gem install refinerycms
2. Create the new app with heroku configuration (you must to have installed heroku toolbet and the heroku gem. See https://toolbelt.heroku.com/ and http://rubygems.org/gems/heroku for more information).
refinerycms myapp --heroku
3.a. Setting production environment for heroku postgres database. Modify Gemfile adding new production group for deployment
group :production do
# Postgres support (added for Heroku)
gem 'pg'
end
3.b. Run bundle
bundle install
3.c. Add, commit and push your changes in your heroku repository
git add Gemfile
git add Gemfile.lock
git commit -m "setup for Heroku"
git push heroku master
4.a. Set up asset precompilation. Modify adding to your config/application.rb file the next line at the end of the config block
config.assets.initialize_on_precompile = true
4.b. Commit the new changes
git add config/application.rb
git commit -m "Set up asset precompilation"
4.c. Enable the experimental user-env-compile option on Heroku (It seems to be optional)
heroku labs:enable user-env-compile
5. Initialize and seed the database on Heroku
heroku run rake db:migrate
heroku run rake db:seed
6. Compile assets locally, run next command
RAILS_ENV=production bundle exec rake assets:precompile
7. commit and push the new changes
git add public/assets
git commit -m "vendor compiled assets"
git push heroku master
8. Go to the new refinery site and cofigure from scratch
http://poorchan.herokuapp.com/refinery
Installing RefineryCMS Blog engine
1. Update your Gemfile (is highly recomended that you get this gems from Github)
gem 'refinerycms-blog', github: 'refinery/refinerycms-blog', branch: 'master'
gem 'refinerycms-settings', github: 'refinery/refinerycms-settings', branch: 'master'
2. Run bundle in your terminal
bundle install
3. Run rake to upgrade your database on Heroku
heroku run rake db:migrate
heroku run rake db:seed
4. Go to your dashboard site to start blogging
http://poorchan.herokuapp.com/refinery/blog/posts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment