Added by on 2013-10-28

Spree is a complete open source e-commerce solution for Ruby on Rails.

1. Install imagemagick
To install ImageMagick, download it from http://www.imagemagick.org/script/binary-releases.php#windows
and then run

$ brew install imagemagick

Spree also uses the ImageMagick library for manipulating images. Using this library allows for automatic resizing of product images and the creation of product image thumbnails. ImageMagick is not a Rubygem and it can be a bit tricky to install. There are, however, several excellent sources of information on the Web for how to install it. A basic Google search should help you if you get stuck.

2. Create a Rails application

rails new store
cd store

3. Edit the Gem file
Open Gem file

gem 'spree', '0.70.1'

4. Run bundle to install spree

bundle

Generate the site

rails g spree:site

As you can see the generated site contains in “app/assets” always 2 folders: “admin” and “store” which respresents the administrator area and the frontend.

5. Migrate the database

$ rake db:bootstrap

When it asks for for email and password, just keep them empty.
When it asks to load sample data, choose “y” to install them.

6. Run the application

$ rails s

The administration is available athttp://localhost:3000/admin
Email: spree@example.com
Password: spree12

7. Install theme
You can install https://github.com/spree/spree_blue_theme
Add this line at the end of your gem file

gem 'spree_blue_theme', :git => 'git://github.com/spree/spree_blue_theme.git'

and to make it works, update “app/assets/stylesheets/store/all.css” so it looks like

/*
 *..........
 *

 *= require store/screen

 *= require_self
 *= require_tree 
*/

8. Customize theme
To customize the theme, go to “config/initializers/” and add a file named “spree_config.rb”.
There you can edit the logo by doing

Spree::Config.set(logo: "store/rails.png")

9. Overide theme
Use Deface: https://github.com/spree/deface
Go to “app/overrides” and create “logorb” file

Deface::Override.new(:virtual_path => "mayouts/spree_application", 
                     :name => "anyName", 
                     :replace_contents => "#logo", 
                     :text => "My logo text")

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*