So...
It looks like there are two ways to get started with Spree as far as implementing it into your Rails application, neither of which work...
Method A
$ spree mystore
Result
spree: command not found
Method B
$ rails cart
$ cd cart
$ rails g spree:site
Result
I get spit out the man page for the "rails" command as if it has no idea what I'm talking about.
Usage:
rails new APP_PATH [options]
Options:
-J, [--skip-prototype] # Skip Prototype files
-T, [--skip-test-unit] # Skip Test::Unit files
[--dev] # Setup the application with Gemfile pointing to your Rails checkout
-G, [--skip-git] # Skip Git ignores and keeps
-m, [--template=TEMPLATE] # Path to an application template (can be a filesystem path or URL)
-b, [--builder=BUILDER] # Path to an application builder (can be a filesystem path or URL)
and so on...
Here's what I've done:
$ sudo gem install spree #and all of its dependencies
My Gemfile:
source :rubygems
# Generic gem dependencies first
gem 'mysql2'
gem 'newrelic_rpm'
# Followed by spree itself first, all spree-specific extensio开发者_StackOverflow中文版ns second
gem 'spree'
gem 'spree_active_shipping', :git => 'https://github.com/spree/spree_active_shipping.git'
gem 'spree_product_assembly', :git => 'git://github.com/spree/spree-product-assembly.git'
gem 'spree_static_content', :git => 'git://github.com/spree/spree_static_content.git'
# EOF
And ran
$ bundle install
So what am I missing, my wonderful S.O. community?
As they described on their Github, you have to a create a new rails application and add gem 'spree' to gemfile and then do bundle install.
Got this figured out.
- HAS to be Rails 3. I became a big boy yesterday and upgraded.
- Ran into a crapton of problems after this so make sure spree gemversion matches in gemfile and with your gem list (mine was 0.50.2) this doesn't really happen by default.
This
gem 'spree_static_content', :git => 'git://github.com/spree/spree-static-content.git'
has to become
gem 'spree_static_content', :git => 'git://github.com/spree/spree_static_content.git'
in your gemfile, the documentation is wrong.
You have to edit line #6 in /home/user/.bundler/ruby/1.8/spree_active_shipping-cb4f80aeb9c9/lib/tasks/active_shipping_extension_tasks.rake to reflect "RAILS_ROOT" instead of "something_shippy_thingy.root"
You have to run
rails g spree_product_assembly:install rails g spree_static_content:install rake db:migrate
So yeah, a lot of digging and most of this NOT in the documentation. Hopefully someone else finds this and its useful
精彩评论