Gem狂欢在Rails 5中不起作用

时间:2016-08-04 12:44:48

标签: ruby-on-rails ruby

Gem spree在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。

4 个答案:

答案 0 :(得分:2)

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

  

gem&#39; spree&#39;,github:&#39; spree / spree&#39;

     

gem&#39; spree_auth_devise&#39;,github:&#39; spree / spree_auth_devise&#39;

     

gem&#39; spree_gateway&#39;,github:&#39; spree / spree_gateway&#39;

https://github.com/spree/spree

答案 1 :(得分:1)

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

答案 2 :(得分:0)

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

Rails 5:

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

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

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

答案 3 :(得分:0)

我使用的是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

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