尝试在新的Rails项目中安装Spree时,我收到以下错误。我安装了Rails 4.2.5版,Ruby版本2.3.0p0
$ spree install --auto-accept
[WARNING] Spree CMD Installer is deprecated. Please follow installation instructions at https://github.com/spree/spree#getting-started
/usr/local/rvm/rubies/ruby- 2.3.0/lib/ruby/2.3.0/rubygems/specification.rb:2158:in `method_missing': undefined method `this' for #<Gem::Specification:0x3fcb12418c74 activesupport-5.0.0.1> (NoMethodError)
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/specification.rb:1057:in `find_active_stub_by_path'
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:64:in `require'
from /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/core_ext/string.rb:1:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `require'
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `rescue in require'
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
from /usr/local/rvm/gems/ruby-2.3.0/gems/spree_cmd-3.1.1/lib/spree_cmd/installer.rb:2:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/rvm/gems/ruby-2.3.0/gems/spree_cmd-3.1.1/lib/spree_cmd.rb:14:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/rvm/gems/ruby-2.3.0/gems/spree_cmd-3.1.1/bin/spree:2:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.3.0/bin/spree:23:in `load'
from /usr/local/rvm/gems/ruby-2.3.0/bin/spree:23:in `<main>'
from /usr/local/rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
from /usr/local/rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'`
答案 0 :(得分:1)
嘿,如果你想使用spree 3.1
那么
Required rails rails (~> 4.2.6)
我测试过狂热3.0 stable with 4.2.2
它可能适用于您的版本,因此您可以创建应用https://github.com/spree/spree/tree/3-0-stable
答案 1 :(得分:0)
根据第一行日志
Spree CMD Installer is deprecated. Please follow installation instructions at https://github.com/spree/spree#getting-started
这意味着..
$ spree install --auto-accept
不会工作.. !!
将rails升级到4.2.6,然后按照步骤操作。
将狂欢宝石添加到您的Gemfile:
gem 'spree', '~> 3.1.0'
gem 'spree_auth_devise', '~> 3.1.0'
gem 'spree_gateway', '~> 3.1.0'
运行bundle install
使用安装生成器设置Spree:
rails g spree:install --user_class=Spree::User
rails g spree:auth:install
rails g spree_gateway:install
最后
rails g spree:install