缺少模板 缺少模板spree / addresses / index,spree / store / index,spree / base / index,application / index with {:locale => [:de,:en],:formats => [:html],:handlers => [:erb,:builder,:raw,:ruby,:jbuilder,:coffee,:haml,:rabl],:versions => [:v1]}。搜索:*" / Users / Manu / Documents / rails_projects / my_store_dev / app / views" *" /Users/Manu/.rvm/gems/ruby-2.1.2/bundler/gems/spree_my_favourites-6076d6ee5cb2/app/views" *" /Users/Manu/.rvm/gems/ruby-2.1.2/bundler/gems/spree_address_book-b66e2abf6429/app/views" *" /Users/Manu/.rvm/gems/ruby-2.1.2/bundler/gems/spree-promotion-roles-rule-0fd33e96c5c4/app/views" *" /Users/Manu/.rvm/gems/ruby-2.1.2/bundler/gems/spree-promotion-exclude-specials-rule-1debc9765387/app/views" *" /Users/Manu/.rvm/gems/ruby-2.1.2/bundler/gems/spree_better_terms_and_conditions-8001a85040eb/app/views" *" /Users/Manu/.rvm/gems/ruby-2.1.2/gems/spree_quick_cart-2.2.3/app/views" *" /Users/Manu/.rvm/gems/ruby-2.1.2/bundler/gems/spree_i18n-1d94e07c68c7/app/views" *" /Users/Manu/.rvm/gems/ruby-2.1.2/bundler/gems/spree_auth_devise-01901766a256/lib/views/backend" *" /Users/Manu/.rvm/gems/ruby-2.1.2/bundler/gems/spree_auth_devise-01901766a256/lib/views/frontend" *" /Users/Manu/.rvm/gems/ruby-2.1.2/gems/devise-3.2.4/app/views" *" /Users/Manu/.rvm/gems/ruby-2.1.2/bundler/gems/spree_gateway-5cbe3890d1a0/app/views" *" /Users/Manu/.rvm/gems/ruby-2.1.2/bundler/gems/spree-33c8fa4d51d8/frontend/app/views" *" /Users/Manu/.rvm/gems/ruby-2.1.2/bundler/gems/spree-33c8fa4d51d8/backend/app/views" *" /Users/Manu/.rvm/gems/ruby-2.1.2/bundler/gems/spree-33c8fa4d51d8/api/app/views" *" /Users/Manu/.rvm/gems/ruby-2.1.2/bundler/gems/spree-33c8fa4d51d8/core/app/views" *" /Users/Manu/.rvm/gems/ruby-2.1.2/gems/kaminari-0.15.1/app/views"
这是我的路线档案:
Spree::Core::Engine.routes.draw do
# Add your extension routes here
namespace :account do
resources :orders, only: [:index]
resources :favourites, only: [:index]
resources :addresses, only: [:index]
end
end
这是AddressesController
中的controller/spree/account/
:
module Spree
module Account
class AddressesController < Spree::StoreController
before_filter :check_logged_in_user
def index
@user = try_spree_current_user
end
private
def check_logged_in_user
unless try_spree_current_user
account_addresses__path
redirect_to spree_login_path
end
end
end
end
end
我在index.haml
中有views/spree/account/addresses/
,这是佣金路线的一部分:
account_orders GET /account/orders(.:format) spree/account/orders#index
account_favourites GET /account/favourites(.:format) spree/account/favourites#index
account_addresses GET /account/addresses(.:format) spree/account/addresses#index
有人可以给我一个提示吗?
答案 0 :(得分:3)
我有类似的经历,不确定这是否适用于你,但这里是:
这是我得到的错误:
ActionView::MissingTemplate at / .
Missing partial spree/shared/_google_analytics with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby, :coffee, :haml, :jbuilder, :rabl], :versions=>[:v1]}. Searched in:
* "/Users/sjones/work/cs-spree/app/views"...
但事实证明部分实际存在,甚至被解析和运行(我使用RubyMine调试器来检查)
错误不正确。在我的情况下,控制器中缺少一个辅助方法try_spree_current_user
,这个丢失的方法NoMethodError
错误以某种方式被捕获并替换为显示的MissingTemplate
错误。
修复该错误导致模板加载得很好。
就像我说的,这可能不是你的问题,但这很奇怪,我正在为别人发布这个。
答案 1 :(得分:2)
安装扩展程序spree_theme
后出现此错误 Missing partial spree/shared/_google_analytics
我最终在这里找到文件(因此根本没有丢失):public/vinsol_spree_themes/current/views/spree/shared/_google_analytics.js.erb
经过一点调试之后,最终检测到class not defined
类型的Spree::Tracker
类型错误,因此我要做的就是修复该依赖关系,并且事情奏效了,如上所述 {> {3}}的“ strong>”功能,有时此消息似乎与文件本身无关,但与外部原因有关
如果您以这种方式进行操作,这就是我从头开始生成项目的方式,那么您可能再也不会遇到任何问题了,并且可以正常运行大礼包3.5
从头开始疯狂安装
**假设您有一个空的Rails应用程序**
更新Gemfile
gem 'spree', '~> 3.5.0'
gem 'spree_auth_devise', '~> 3.3'
gem 'spree_gateway', '~> 3.3'
安装开发依赖项
1)bundle update i18n
(我认为这是可选的,但不确定)
2)bundle install
安装安装生成器以设置Spree:
1)rails g spree:install --user_class=Spree::User
系统将要求您设置一个管理员帐户
Email [spree@example.com]: admin@cucg.com
Password [spree123]:
然后只需运行rails s
,您将大功告成
我刚刚遵循了这个stujo,一切都很好
答案 2 :(得分:0)
您需要在您的haml文件名中包含html。
像这样:
your_file_name.html.haml
将索引文件重命名为:
index.html.haml
在这里阅读更多关于haml的信息: