Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Unable to load Spree sample data on Windows 7 (using RailsInstaller) #711
Using Windows 7 (with Rails Installer), following through the guide at http://guides.spreecommerce.com/getting_started.html successfully installs Spree and migrates the database but does not load sample data.
When I run 'bundle exec rake spree_sample:load' the only output I get is:
When I run rake db:bootstrap I am asked if I would like to create sample data. If I enter 'y' then I immediately see bootstrap complete.
Here's the full output following through the instructions in the guide:
C:\Sites>rails new spree -d sqlite3 --skip-test-unit
Your bundle is complete! Use
C:\Sites\spree>rails g spree:site
C:\Sites\spree>bundle exec rake spree_sample:load
Load Sample Data? [y/n]: y
did you "gem install spree" or just added it to gemfile?
Besides this, i have moved to Ubuntu for developing rails apps. Windows was too much of a pain for everything rails related (bugs, slow as hell, some gems not working, native compile errors etc etc)
Sorry for the delay getting back to you - I've been away.
From memory I'm pretty sure that I did gem install Spree.
For personal projects I develop on my mac and it does run a lot
Thanks for your time.
On 2 November 2011 20:13, Suzi
After it asks to load sample data (y/n), and you respond y, the script quits and no sample data is ever loaded into the local database. I never found a way to populate the local database with the sample data. I think it's a Windows issue, and I think that is what Ben and Vinay were seeing as well.
rake db:bootstrap AUTO_ACCEPT=1 runs ok. Runs through tons of migrations very quickly. But it leaves the database empty with no test data. Without having at least one taxon ("Categories"), I end up with errors from the start:
undefined method `root' for nil:NilClass.
<% else %>
12: <% Taxonomy.where(:name => "Categories").first.root.children.each_with_index do |taxon,i| %>
14: <% end %>
I just added the spree gem to my gemfile (I did not do gem install) if that helps.
The only output is a deprecation warning:
C:\Sites\spree>bundle exec rake spree_sample:load[DEPRECATION WARNING]
On 15 November 2011 02:46, Ryan Bigg
I also am getting the same behavior as Ben-M and adamwible. The sample data is not loaded. I am on Window's 7 (pro version) and have followed the instructions as noted above. I would really like to use this gem as I think the idea is great. However with being able to evaluate it, I can not risk importing this to my customers. Can anybody help on this issue? Many thanks.
The solution is unbelievably simple. I'm using Spree version 0.70.3.
File '\spree_core-0.70.3\lib\tasks\core.rake', line 23 (see on GitHub):
dir = File.join(Rails.root, "db", dir) unless dir.first == "/"
Of course it does not work with windows paths starting with 'c:/' for instance. The line should rather look like:
dir = File.join(Rails.root, "db", dir) unless dir =~ /^(\/|[a-zA-Z]:[\/\\])/
With such a change the data import works like a charm.
added a commit
Dec 8, 2011
referenced this issue
Feb 2, 2012
Hey guys i got a similar error while running rake db:seed on Ubuntu machine.
Devise.secret_key = "7337eb039cc302ec2c2d6f5ade14d1393d4ba7824cc7058e0faaea71fd306ea520076a1dcdeaea2689852ace1b38e159832f"
*****There are more lines of error below but i removed it the main would be :StatementInvalid: SQLite3::SQLException: near "," ***
Can someone plese provide some help on this