我跟着https://guides.spreecommerce.com/developer/extensions_tutorial.html并完成了扩展程序spree_simple_sales。一切都在发展中很好。但我无法弄清楚如何部署它。
当我跑步时
rails g spree_simple_seals:install
它给了我
append vendor/assets/javascripts/spree/frontend/all.js
append vendor/assets/javascripts/spree/backend/all.js
insert vendor/assets/stylesheets/spree/frontend/all.css
insert vendor/assets/stylesheets/spree/backend/all.css
run bundle exec rake railties:install:migrations FROM=spree_simple_sales from "."
Would you like to run the migrations now? [Y/n] y
run bundle exec rake db:migrate from "."
似乎没有复制其他任何添加的代码。但不知何故,应用程序运行正常。这是如何工作的?
然后我尝试将其部署到heroku。但是,毫无疑问,存在这样的错误:
The path `/tmp/spree_extensions/spree_simple_sales` does not exist.
这样做的正确方法是什么?
这是Gemfile。最后一个是spree_simple_sales扩展,带有本地目录的路径,如教程所示:
source 'https://rubygems.org'
ruby '2.2.0'
gem 'rails', '4.2.1'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
group :development, :test do
gem 'byebug'
gem 'sqlite3'
gem 'web-console', '~> 2.0'
gem 'spring'
end
group :production do
gem 'pg'
gem 'rails_12factor'
gem 'puma'
end
gem 'spree', '3.0.0'
gem 'spree_gateway', github: 'spree/spree_gateway', branch: '3-0-stable'
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '3-0-stable'
gem 'spree_simple_sales', path: '../spree_extensions/spree_simple_sales'
答案 0 :(得分:1)
想出来。只需将扩展目录放在/ vendor下并从Gemfile引用它,它就可以在heroku上运行。
答案 1 :(得分:0)
我有同样的问题。通过查询spree社区,我发现添加自定义扩展的正确方法是给它自己的git repo,然后在gem文件中引用git repo。
gem' spree_simple_sales',github:' username / spree_simple_sales'