Saturday, April 17, 2010

Getting started with Heroku and Spree: Part 5 - Setting up Heroku [GUIDE]

At Gunner Technology, we have found that if we give a little, we usually get more in return.

Here's what I mean. Most of our clients know nothing about the Internet other than some buzz words around it. Giving them specs, bids, wireframes, sample recommendations, etc isn't very powerful.

We've found that building a prototype and showing them examples of what we want to do is about five times more likely to end in a relationship than if we try to tell them what we want to do.

This means banging out a WordPress site on a shared host. Setting up a Twitter account and faking interaction, promotions and messages.

Right now, we're working on forming a relationship with a Mexican restaurant. They don't have a Web site, and we feel they could see a 30% increase in sales by taking orders online, registering their site with Yelp, Google and Bing and implementing a Twitter/Foursquare marketing campaign.

So, we're going to put together a demo site for them using Spree and we'll host it for free with Heroku.

We also have a new MacBook Pro we're going to set up from scratch to get this started, so we figured we'd take you through the whole process, step by step.

This is part 5: Setting up Heroku
  1. Sign up for a Heroku account
  2. Check your inbox for the confirmation email and follow the instructions
  3. You'll end up at a screen to complete your registration by creating a password
  4. Create a new git repository for your app:
    cd your-site-name
    git init && git add . && git commit -m "first commit"
  5. Open a terminal and run (with RVM, you do not use "sudo"): gem install heroku
  6. Generate RSA key by running this from terminal (just keep the two prompts blank by hitting "enter"): ssh-keygen
  7. Generate DSA key by running this from terminal (just keep the two prompts blank by hitting "enter"): ssh-keygen -t dsa
  8. Create your heroku app. We provide the stack flag because spree requires Ruby 1.8.7 or higher and Heroku's default stack runs 1.8.6: heroku create your-site-name --stack bamboo-ree-1.8.7
  9. Enable SSL, since Spree uses SSL for administration and payment flow in its standard setup (You'll have to provide account verification for your Heroku account first, but don't worrry this is free as in beer:
    heroku addons:add "Piggyback SSL"
  10. Copy your local database structure to Heroku's Postreges database:
    heroku db:push
  11. Deploy your code: git push heroku master
  12. Configure your app for S3:
    heroku console
    >> Spree::Heroku::Config.set(:bucket => 'bucket name')
    >> Spree::Heroku::Config.set(:access_key_id => 'access key')
    >> Spree::Heroku::Config.set(:secret_access_key => 'secret access key')
    >> exit
    heroku restart

  13. Go to the url for your app: http://your-site-name.heroku.com

Woot! Your e-commerce site is now live! We'll configure it next time!

Follow Me | Friend Me | Find Me
blog comments powered by Disqus