« Previous - Version 13/15 (diff) - Next » - Current version
Guillermo Gómez, 03/28/2011 06:32 pm


Spree

El camino "más suave" es:

$ sudo gem install rails (si Rails 3)

Cree su proyecto nuevo:

$ rails new mystore
...
$ cd mystore

Edite GemFile y agregue:

...
$ gem 'spree'
Using the Gem
-------------

Start by adding the gem to your existing Rails 3.x application's Gemfile

    gem 'spree'

Update your bundle

    bundle install

Then use the install generator to do the basic setup (add Spree to Gemfile, etc.)

    rails g spree:site

Now its time to install all of the necessary migrations, assets, etc.

    rake spree:install

If you'd like to also install sample data and images you can follow up the above command with:

    rake spree_sample:install

Now you just need to run the new migrations

    rake db:migrate
    rake db:seed

If you also want some sample products, orders, etc. to play with you can run the appropriate rake task.

    rake db:sample
[gomix@fricky mystore]$ bundle install
Fetching source index for http://rubygems.org/
Enter your password to install the bundled RubyGems to your system: 
Using rake (0.8.7) 
Using abstract (1.0.0) 
Using activesupport (3.0.5) 
Using builder (2.1.2) 
Installing i18n (0.5.0) 
Using activemodel (3.0.5) 
Using erubis (2.6.6) 
Installing rack (1.2.2) 
Installing rack-mount (0.6.14) 
Using rack-test (0.5.7) 
Installing tzinfo (0.3.25) 
Using actionpack (3.0.5) 
Using mime-types (1.16) 
Using polyglot (0.3.1) 
Using treetop (1.4.9) 
Using mail (2.2.15) 
Using actionmailer (3.0.5) 
Using braintree (2.9.1) 
Using activemerchant (1.12.0) 
Using arel (2.0.9) 
Using activerecord (3.0.5) 
Using activeresource (3.0.5) 
Using acts_as_list (0.1.2) 
Using bcrypt-ruby (2.1.4) 
Using bundler (1.0.10) 
Using cancan (1.5.1) 
Using orm_adapter (0.0.4) 
Using warden (1.0.3) 
Using devise (1.2.rc2) 
Using faker (0.9.5) 
Using highline (1.5.1) 
Using thor (0.14.6) 
Using railties (3.0.5) 
Using rails (3.0.5) 
Using jquery-rails (0.2.6) 
Using meta_search (1.0.1) 
Using nested_set (1.6.4) 
Using paperclip (2.3.8) 
Using rd_resource_controller (1.0.1) 
Using rd_unobtrusive_date_picker (0.1.0) 
Using state_machine (0.9.4) 
Using stringex (1.0.3) 
Using will_paginate (3.0.pre2) 
Using spree_core (0.50.0) 
Using spree_api (0.50.0) 
Using spree_auth (0.50.0) 
Using spree_dash (0.50.0) 
Using spree_promo (0.50.0) 
Using spree_sample (0.50.0) 
Using spree (0.50.0) 
Installing sqlite3 (1.3.3) with native extensions 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
[gomix@fricky mystore]$ rails g spree:site
      create  lib/spree_site.rb
      remove  public/index.html
      append  public/robots.txt
      append  db/seeds.rb

[gomix@fricky mystore]$ rake spree:install
(in /home/gomix/tmp/spree-tempo/mystore)
INFO: Mirroring assets from /usr/lib/ruby/gems/1.8/gems/spree_dash-0.50.0/lib/tasks/../../public to /home/gomix/tmp/spree-tempo/mystore/public
INFO: Mirroring assets from /usr/lib/ruby/gems/1.8/gems/spree_promo-0.50.0/lib/tasks/../../public to /home/gomix/tmp/spree-tempo/mystore/public

[gomix@fricky mystore]$ rake spree_sample:install
...

[gomix@fricky mystore]$ rake db:migrate
...
==  AddPositionToOptionTypes: migrating =======================================
-- add_column(:option_types, :position, :integer, {:null=>false, :default=>0})
   -> 0.0016s
==  AddPositionToOptionTypes: migrated (0.0019s) ==============================

==  RemoveTrailingSlashesInTaxonPermalinks: migrating =========================
==  RemoveTrailingSlashesInTaxonPermalinks: migrated (0.0049s) ================

[gomix@fricky mystore]$ rake db:seed
(in /home/gomix/tmp/spree-tempo/mystore)
loading fixture /home/gomix/tmp/spree-tempo/mystore/db/default/countries.yml
loading fixture /home/gomix/tmp/spree-tempo/mystore/db/default/roles.yml
loading fixture /home/gomix/tmp/spree-tempo/mystore/db/default/states.yml
loading fixture /home/gomix/tmp/spree-tempo/mystore/db/default/zone_members.yml
loading fixture /home/gomix/tmp/spree-tempo/mystore/db/default/zones.yml
Default data has been loaded

Pantallazo-Spree-Demo.png - Spree Demo (86.5 kB) Guillermo Gómez, 03/28/2011 06:38 pm