0

所以...

看起来有两种方法可以开始使用 Spree,只要将它实现到你的 Rails 应用程序中,这两种方法都不起作用......

方法A

$ spree mystore

结果

spree: command not found

方法B

$ rails cart
$ cd cart
$ rails g spree:site

结果

我吐出了“rails”命令的手册页,好像它不知道我在说什么。

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)

等等...


这是我所做的:

$ sudo gem install spree #and all of its dependencies

我的宝石文件:

source :rubygems
# Generic gem dependencies first
gem 'mysql2'
gem 'newrelic_rpm'

# Followed by spree itself first, all spree-specific extensions 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

然后跑了

$ bundle install

那么我错过了什么,我美妙的 SO 社区?

4

2 回答 2

1

正如他们在Github上所描述的,您必须创建一个新的 rails 应用程序并将 gem 'spree' 添加到 gemfile 中,然后进行捆绑安装。

于 2011-05-06T15:07:52.763 回答
0

想通了这个。

  • 必须是Rails 3。我昨天变成了一个大男孩并升级了。
  • 在此之后遇到了一大堆问题,因此请确保在 gemfile 和您的 gem 列表(我的是 0.50.2)中的 spree gemversion 匹配,这在默认情况下不会真正发生。
  • 这个

    gem 'spree_static_content', :git => 'git://github.com/spree/spree-static-content.git'
    

必须成为

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

在您的 gemfile 中,文档是错误的。

  • 您必须编辑 /home/user/.bundler/ruby/1.8/spree_active_shipping-cb4f80aeb9c9/lib/tasks/active_shipping_extension_tasks.rake 中的第 6 行以反映“RAILS_ROOT”而不是“something_shippy_thingy.root”

  • 你必须跑

    rails g spree_product_assembly:install
    rails g spree_static_content:install
    rake db:migrate
    

所以,是的,很多挖掘和大部分不在文档中。希望其他人发现这个及其有用

于 2011-05-07T14:36:25.863 回答