Rails - How To Get Sample Data With Spree Commerce Sandbox
<p>I downloaded the <code>Spree Commerce</code> version 3.0.8 code from GitHub so I can directly customize the code myself for my school project. According to the direction in this link:</p>

<p><a href="https://github.com/spree/spree/tree/v3.0.8" rel="nofollow">https://github.com/spree/spree/tree/v3.0.8</a></p>

<p>I ran the following:</p>

<pre><code>bundle install
bundle exec rake sandbox
cd sandbox
rails server
</code></pre>

<p>However, this came with no sample data like it originally did when I used Spree as a gem. How do I get the same sample data in my sandbox application?</p>

<p>According to Bharat soni's answer, I tried the following:</p>

<pre><code>bundle exec rake db:seed
</code></pre>

<p>But after running this first command, I got the following "rake aborted" error:</p>

<pre><code>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 `&lt;top (required)&gt;'
/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 &lt;top (required)&gt;'
/Users/rafi7/Desktop/Schoolwork/Senior/Spring/CSC394/Medical Project/spree/core/lib/tasks/core.rake:30:in `block (3 levels) in &lt;top (required)&gt;'
/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 &lt;top (required)&gt;'
/Users/rafi7/Desktop/Schoolwork/Senior/Spring/CSC394/Medical Project/spree/core/db/seeds.rb:5:in `&lt;top (required)&gt;'
/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 `&lt;top (required)&gt;'
/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 &lt;top (required)&gt;'
Tasks: TOP =&gt; db:load_dir
(See full trace by running task with --trace)
</code></pre>