Ich habe die Spree Commerce
Version 3.0.8 Code von GitHub heruntergeladen, so dass ich den Code für mein Schulprojekt direkt anpassen kann. Nach der Richtung, in diesem Link:Rails - So erhalten Sie Beispieldaten mit Spree Commerce Sandbox
https://github.com/spree/spree/tree/v3.0.8
Ich lief wie folgt vor:
bundle install
bundle exec rake sandbox
cd sandbox
rails server
Allerdings kam dies ohne Beispieldaten wie es ursprünglich tat, als ich Spree als Edelstein verwendet. Wie bekomme ich die gleichen Beispieldaten in meiner Sandbox-Anwendung?
Nach Bharat soni Antwort, habe ich versucht, die folgenden:
bundle exec rake db:seed
aber nach diesem ersten Befehl ausführen, bekam ich die folgende Fehlermeldung "Rake abgebrochen":
Rafi-MacBook-Air:sandbox rafi7$ bundle exec rake db:seed
loading ruby /Users/rafi7/Desktop/Schoolwork/Senior/Spring/CSC394/Medical Project/spree/core/db/default/spree/countries.rb
loading ruby /Users/rafi7/Desktop/Schoolwork/Senior/Spring/CSC394/Medical Project/spree/core/db/default/spree/default_reimbursement_type.rb
loading ruby /Users/rafi7/Desktop/Schoolwork/Senior/Spring/CSC394/Medical Project/spree/core/db/default/spree/roles.rb
loading ruby /Users/rafi7/Desktop/Schoolwork/Senior/Spring/CSC394/Medical Project/spree/core/db/default/spree/states.rb
loading ruby /Users/rafi7/Desktop/Schoolwork/Senior/Spring/CSC394/Medical Project/spree/core/db/default/spree/stores.rb
loading ruby /Users/rafi7/Desktop/Schoolwork/Senior/Spring/CSC394/Medical Project/spree/core/db/default/spree/zones.rb
rake aborted!
ActiveRecord::RecordInvalid: Validation failed: Name has already been taken
/Users/rafi7/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.6/lib/active_record/validations.rb:79:in `raise_record_invalid'
/Users/rafi7/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.6/lib/active_record/validations.rb:43:in `save!'
/Users/rafi7/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.6/lib/active_record/attribute_methods/dirty.rb:29:in `save!'
/Users/rafi7/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.6/lib/active_record/transactions.rb:291:in `block in save!'
/Users/rafi7/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.6/lib/active_record/transactions.rb:351:in `block in with_transaction_returning_status'
/Users/rafi7/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
/Users/rafi7/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction'
/Users/rafi7/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
/Users/rafi7/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.6/lib/active_record/transactions.rb:220:in `transaction'
/Users/rafi7/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.6/lib/active_record/transactions.rb:348:in `with_transaction_returning_status'
/Users/rafi7/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.6/lib/active_record/transactions.rb:291:in `save!'
/Users/rafi7/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.6/lib/active_record/persistence.rb:51:in `create!'
/Users/rafi7/Desktop/Schoolwork/Senior/Spring/CSC394/Medical Project/spree/core/db/default/spree/zones.rb:1:in `<top (required)>'
/Users/rafi7/.rvm/gems/ruby-2.3.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/Users/rafi7/.rvm/gems/ruby-2.3.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/Users/rafi7/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `block in require'
/Users/rafi7/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency'
/Users/rafi7/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require'
/Users/rafi7/Desktop/Schoolwork/Senior/Spring/CSC394/Medical Project/spree/core/lib/tasks/core.rake:11:in `block (2 levels) in <top (required)>'
/Users/rafi7/Desktop/Schoolwork/Senior/Spring/CSC394/Medical Project/spree/core/lib/tasks/core.rake:30:in `block (3 levels) in <top (required)>'
/Users/rafi7/Desktop/Schoolwork/Senior/Spring/CSC394/Medical Project/spree/core/lib/tasks/core.rake:24:in `each'
/Users/rafi7/Desktop/Schoolwork/Senior/Spring/CSC394/Medical Project/spree/core/lib/tasks/core.rake:24:in `block (2 levels) in <top (required)>'
/Users/rafi7/Desktop/Schoolwork/Senior/Spring/CSC394/Medical Project/spree/core/db/seeds.rb:5:in `<top (required)>'
/Users/rafi7/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:in `load'
/Users/rafi7/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:in `block in load'
/Users/rafi7/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency'
/Users/rafi7/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:in `load'
/Users/rafi7/.rvm/gems/ruby-2.3.0/gems/railties-4.2.6/lib/rails/engine.rb:547:in `load_seed'
/Users/rafi7/.rvm/gems/ruby-2.3.0/gems/railties-4.2.6/lib/rails/railtie.rb:194:in `public_send'
/Users/rafi7/.rvm/gems/ruby-2.3.0/gems/railties-4.2.6/lib/rails/railtie.rb:194:in `method_missing'
/Users/rafi7/Desktop/Schoolwork/Senior/Spring/CSC394/Medical Project/spree/sandbox/db/seeds.rb:10:in `<top (required)>'
/Users/rafi7/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:in `load'
/Users/rafi7/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:in `block in load'
/Users/rafi7/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency'
/Users/rafi7/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:in `load'
/Users/rafi7/.rvm/gems/ruby-2.3.0/gems/railties-4.2.6/lib/rails/engine.rb:547:in `load_seed'
/Users/rafi7/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.6/lib/active_record/tasks/database_tasks.rb:250:in `load_seed'
/Users/rafi7/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.6/lib/active_record/railties/databases.rake:183:in `block (2 levels) in <top (required)>'
Tasks: TOP => db:load_dir
(See full trace by running task with --trace)
Danke, aber nachdem ich lief 'Bündel exec rake db: Samen', bekam ich einen Fehler "Rake abgebrochen". Ich habe meine Frage mit dem vollständigen Fehlerprotokoll aktualisiert. – Rafi