繁体   English   中英

Gem狂欢在Rails 5中不起作用

[英]Gem spree doesn't work in Rails 5

Gem狂欢在Rails 5中不起作用

DEPRECATION WARNING: alias_method_chain is deprecated. Please, use Module#prepend instead. From module, you can access the original method using super. (called from <top (required)> at C:/Users/Sergey/spree/config/application.rb:7)
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:80:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'spree'. (Bundler::GemRequireError)
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler.rb:99:in `require'
        from C:/Users/Sergey/spree/config/application.rb:7:in `<top (required)>'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:88:in `require'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:88:in `block in server'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:85:in `tap'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:85:in `server'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0/lib/rails/commands.rb:18:in `<top (required)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'

我在Gemfile中添加了'spree'gem。

您可以使用最新版本,如下面的狂欢自述文件:

宝石'狂欢',github:'狂欢/狂欢'

gem'spree_auth_devise',github:'spree / spree_auth_devise'

gem'spree_gateway',github:'spree / spree_gateway'

https://github.com/spree/spree

目前spree不适用于rails 5.0,所以如果你想使用它,你必须选择rails 4.2.6(至少)

将狂欢宝石添加到您的Gemfile:

Rails 5:

gem 'spree', '~> 3.2.0.rc1'

gem 'spree_auth_devise', '~> 3.2.0.beta'

gem 'spree_gateway', '~> 3.2.0.beta'

我正在使用Ruby 2.4.0和Rails 5.0.3

将具有特定版本的gem添加到Gemfile。

gem 'spree', '~> 3.2.0' 
gem 'spree_auth_devise', '~> 3.2.0.beta' 
gem 'spree_gateway', '~> 3.2.0.beta'

之后尝试安装以下生成器来设置Spree:

rails g spree:install --user_class=Spree::User
rails g spree:auth:install
rails g spree_gateway:install

它对我有用。 让我知道任何问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM