我有一个正在运行的现有Spree项目。我不会尝试在项目中包含Alchemy CMS。我按照 Github Repo 上的指南进行操作。唯一的例外是我跳过了身份验证步骤,因为我已经配置了spree_auth_devise。尝试安装 Alchemy 时,bundle exec rake alchemy:install
. 我收到以下错误。
错误
rake aborted!
Bundler::GemRequireError: There was an error while trying to load the gem 'alchemy_spree'.
/Users/atbyrd/dev/distinct-existence/config/application.rb:7:in `<top (required)>'
/Users/atbyrd/dev/distinct-existence/Rakefile:4:in `require'
/Users/atbyrd/dev/distinct-existence/Rakefile:4:in `<top (required)>'
NameError: uninitialized constant Alchemy::AuthEngine
/Users/atbyrd/dev/distinct-existence/config/application.rb:7:in `<top (required)>'
/Users/atbyrd/dev/distinct-existence/Rakefile:4:in `require'
/Users/atbyrd/dev/distinct-existence/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)
宝石文件
ruby '2.2.4'
source 'https://rubygems.org'
gem 'rails', '4.2.5'
gem 'pg', '~> 0.15'
gem 'sass-rails'
gem 'uglifier'
gem 'coffee-rails'
gem 'jquery-rails'
gem 'turbolinks'
gem 'active_model_serializers'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'spree', github: 'spree/spree'
gem 'spree_auth_devise', github: 'spree/spree_auth_devise'
gem 'puma'
gem 'paperclip'
gem 'aws-sdk', '< 2.0'
gem 'delayed_job_active_record'
gem 'alchemy_spree'
gem 'alchemy_cms'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
gem 'byebug'
end
group :development do
gem 'web-console', '~> 2.0'
gem 'spring'
end
配置/初始化程序/alchemy.rb
# Tell Alchemy to use the Spree::User class
Alchemy.user_class_name = 'Spree::User'
Alchemy.current_user_method = :spree_current_user
# Load the Spree.user_class decorator for Alchemy roles
require 'alchemy/spree/spree_user_decorator'
# Include the Spree controller helpers to render the
# alchemy pages within the default Spree layout
Alchemy::BaseHelper.send :include, Spree::BaseHelper
Alchemy::BaseController.send :include, Spree::Core::ControllerHelpers::Common
Alchemy::BaseController.send :include, Spree::Core::ControllerHelpers::Store