我试图在旧的Rails应用程序(3.2.5)上安装Spree,以便为网页设置商店部分。
我尝试了不同的gem版本,并成功安装了0.30.0。
在我的gem文件中,我有:
gem 'spree', '0.30.0'
gem 'acts_as_list', '0.1.2'
gem 'paperclip', '2.3.1.1'
gem 'stringex', '1.0.3'
当我尝试创建网站时
rails g spree:site
我收到以下错误:
/Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/bundler-1.16.1/lib/bundler/runtime.rb:85:in `require': There was an error while trying to load the gem 'spree'. (Bundler::GemRequireError)
Gem Load Error is: ActiveRecord::ConnectionNotEstablished
Backtrace for gem load error is:
/Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/activerecord-3.2.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:404:in `retrieve_connection'
/Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/activerecord-3.2.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:168:in `retrieve_connection'
/Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/activerecord-3.2.5/lib/active_record/connection_adapters/abstract/connection_specification.rb:142:in `connection'
/Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/activerecord-3.2.5/lib/active_record/model_schema.rb:228:in `columns'
/Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/activerecord-3.2.5/lib/active_record/model_schema.rb:248:in `column_names'
/Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/rd_searchlogic-3.0.1/lib/searchlogic/named_scopes/ordering.rb:61:in `ordering_condition_details'
/Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/rd_searchlogic-3.0.1/lib/searchlogic/named_scopes/ordering.rb:52:in `method_missing'
/Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/spree_core-0.30.0/lib/spree_core/find_by_param.rb:105
/Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:251:in `gem_original_require'
/Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:251:in `require'
/Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:251:in `require'
/Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:236:in `load_dependency'
/Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:251:in `require'
/Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/spree_core-0.30.0/lib/spree_core.rb:47
/Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/spree-0.30.0/lib/spree.rb:1:in `gem_original_require'
/Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/spree-0.30.0/lib/spree.rb:1:in `require'
/Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/spree-0.30.0/lib/spree.rb:1
/Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/bundler-1.16.1/lib/bundler/runtime.rb:81:in `gem_original_require'
/Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/bundler-1.16.1/lib/bundler/runtime.rb:81:in `require'
/Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/bundler-1.16.1/lib/bundler/runtime.rb:81:in `require'
/Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in `each'
/Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in `require'
/Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in `each'
/Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in `require'
/Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/bundler-1.16.1/lib/bundler.rb:114:in `require'
/Users/Useraccount/Development/SPREE/tst_spree_02/config/application.rb:7
/Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/railties-3.2.5/lib/rails/commands.rb:24:in `gem_original_require'
/Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/railties-3.2.5/lib/rails/commands.rb:24:in `require'
/Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/railties-3.2.5/lib/rails/commands.rb:24
script/rails:6:in `gem_original_require'
script/rails:6:in `require'
script/rails:6
Bundler Error Backtrace:
from /Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in `each'
from /Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in `require'
from /Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in `each'
from /Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in `require'
from /Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/bundler-1.16.1/lib/bundler.rb:114:in `require'
from /Users/Useraccount/Development/SPREE/tst_spree_02/config/application.rb:7
from /Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/railties-3.2.5/lib/rails/commands.rb:24:in `gem_original_require'
from /Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/railties-3.2.5/lib/rails/commands.rb:24:in `require'
from /Users/Useraccount/.rvm/gems/ruby-1.8.7-p374@spree-test-02/gems/railties-3.2.5/lib/rails/commands.rb:24
from script/rails:6:in `gem_original_require'
from script/rails:6:in `require'
from script/rails:6
不幸的是,该Web应用程序未安装较新的版本,而较旧的gem需要较旧的Rails版本。
为什么会发生这种情况,我如何设法使其运行?