ошибка установки spree, rails 3, ubuntu

#ruby-on-rails #spree

#ruby-on-rails #spree

Вопрос:

Я новичок в ruby on rails. Я перехожу по следующим ссылкам, чтобы установить spree. но при запуске bundle exec rake spree_sample:load —trace возникают ошибки. кто-нибудь может помочь?

http://guides.spreecommerce.com/getting_started.html

 mingo@cxm:~/rails/spreetest$ bundle exec rake spree_sample:load --trace
DEPRECATION WARNING: class_inheritable_attribute is deprecated, please use class_attribute method instead. Notice their behavior are slightly different, so refer to class_attribute documentation first. (called from /home/mingo/rails/spreetest/config/application.rb:7)
DEPRECATION WARNING: class_inheritable_attribute is deprecated, please use class_attribute method instead. Notice their behavior are slightly different, so refer to class_attribute documentation first. (called from /home/mingo/rails/spreetest/config/application.rb:7)
DEPRECATION WARNING: class_inheritable_attribute is deprecated, please use class_attribute method instead. Notice their behavior are slightly different, so refer to class_attribute documentation first. (called from /home/mingo/rails/spreetest/config/application.rb:7)
DEPRECATION WARNING: class_inheritable_attribute is deprecated, please use class_attribute method instead. Notice their behavior are slightly different, so refer to class_attribute documentation first. (called from /home/mingo/rails/spreetest/config/application.rb:7)
rake aborted!
Fixtures is not a class
/var/lib/gems/1.8/gems/spree_core-0.30.1/lib/custom_fixtures.rb:3
/var/lib/gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
/var/lib/gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
/var/lib/gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `load_dependency'
/var/lib/gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:640:in `new_constants_in'
/var/lib/gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `load_dependency'
/var/lib/gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
/var/lib/gems/1.8/gems/spree_core-0.30.1/lib/tasks/core.rake:2
/var/lib/gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:234:in `load'
/var/lib/gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:234:in `load'
/var/lib/gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `load_dependency'
/var/lib/gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:640:in `new_constants_in'
/var/lib/gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `load_dependency'
/var/lib/gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:234:in `load'
/var/lib/gems/1.8/gems/railties-3.1.0/lib/rails/engine.rb:397:in `load_tasks'
/var/lib/gems/1.8/gems/railties-3.1.0/lib/rails/engine.rb:397:in `each'
/var/lib/gems/1.8/gems/railties-3.1.0/lib/rails/engine.rb:397:in `load_tasks'
/var/lib/gems/1.8/gems/railties-3.1.0/lib/rails/engine.rb:395:in `load_tasks'
/var/lib/gems/1.8/gems/railties-3.1.0/lib/rails/application/railties.rb:8:in `each'
/var/lib/gems/1.8/gems/railties-3.1.0/lib/rails/application/railties.rb:8:in `all'
/var/lib/gems/1.8/gems/railties-3.1.0/lib/rails/engine.rb:395:in `load_tasks'
/var/lib/gems/1.8/gems/railties-3.1.0/lib/rails/application.rb:99:in `load_tasks'
/var/lib/gems/1.8/gems/railties-3.1.0/lib/rails/railtie/configurable.rb:30:in `send'
/var/lib/gems/1.8/gems/railties-3.1.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
/home/mingo/rails/spreetest/Rakefile:7
/var/lib/gems/1.8/gems/rake-0.9.2/lib/rake/rake_module.rb:25:in `load'
/var/lib/gems/1.8/gems/rake-0.9.2/lib/rake/rake_module.rb:25:in `load_rakefile'
/var/lib/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:495:in `raw_load_rakefile'
/var/lib/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:78:in `load_rakefile'
/var/lib/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/var/lib/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:77:in `load_rakefile'
/var/lib/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:61:in `run'
/var/lib/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/var/lib/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/var/lib/gems/1.8/gems/rake-0.9.2/bin/rake:32
/var/lib/gems/1.8/bin/rake:19:in `load'
/var/lib/gems/1.8/bin/rake:19
mingo@cxm:~/rails/spreetest$ 
  

Комментарии:

1. Могу ли я спросить: как вы установили Spree 0.30.1, когда последняя версия 0.60.2?

Ответ №1:

Вам необходимо использовать пограничную версию Spree с Rails 3.1. Добавьте это в свой Gemfile:

 gem 'spree', :git => 'git://github.com/spree/spree.git'
  

Кроме того, я думаю, что edge Spree совместим только с одним из последних релиз-кандидатов Rails 3.1.1. Возможно, вам также потребуется добавить это в свой Gemfile:

 gem 'rails', :git => 'git://github.com/rails/rails.git', :tag => "v3.1.1.rc1"
  

Комментарии:

1. когда я попробовал это, bundle install выдал мне: Bundler не смог найти совместимые версии для gem «rails» n В Gemfile: n spree (> = 0) ruby зависит от n rails (= 3.1.1) ruby n rails (3.1.1.rc1)

2. Можете ли вы обновить свой вопрос содержимым вашего Gemfile? Я не понимаю, почему у вас там две версии Rails.

3. у меня не было двух версий rails в gemfile, то, что я опубликовал, было выводом «bundle install» при попытке использовать решение в вашем ответе. я думаю, что пограничная версия Spree (в настоящее время 0.70) теперь использует rails 3.1.1, а не 3.1.1rc1, вот почему у меня возникла ошибка. теперь ее можно решить, установив spree 0.70 и rails 3.1.1