Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Creating a Spree Site...

Creating a Spree Site

Here's how to get up and running on version 0.70.x of Spree Commerce... For previous versions please refer to these instructions.

We'll be using Bundler and Rails 3.1, so make sure you've got those installed before moving on...

First create a new rails project:

rails new my_spree_site

Next, remove some unnecessary files:

rm public/index.html public/images/rails.png

Now, just like any other rails app, configure your config/database.yml file to your liking. When you're ready, open your Gemfile and make it look something like this:

source ''

gem 'rails',  '3.1.3'
gem 'pg'

gem 'spree',  '0.70.3'

When you're done, save and close the Gemfile, then install your gems with:

bundle install

Once that's complete we need to install Spree into our new rails app. We do that with a rake command:

rails g spree:site

This will copy all the necessary migrations, images, javascripts, and stylesheets to your new project. Now we're ready to migrate and prep the database using more rake commands:

rake db:bootstrap

The sample data will load then you'll be prompted to create an admin user. I usually just press enter to use the defaults...

Ok so if everything went according to plan, we should be able to start the server by running:

bundle exec rails s

If that worked and you see the default spree site, then give yourself a pat on the back or crack open a cold one. Good job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment