0

我有一个正在运行的现有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
4

1 回答 1

1

看起来像过时的 gem 版本。您使用的是哪个版本的 Spree?请检查您的Gemfile.lock. 如果是 3.x,那么请尝试通过gem 'alchemy_spree', github: 'magiclabs/alchemy_spree', branch: 'master'在你的Gemfile和运行中使用这个 gem 的 GitHub 版本bundle update alchemy_spree

而且,关于自述文件,如果您使用spree_auth_devise. 跳过这一步是行不通的。

我上面提到的所有内容都在项目的 README 中进行了说明。你跟了吗?

于 2015-12-21T07:34:14.183 回答