New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load Spree sample data on Windows 7 (using RailsInstaller) #711

Closed
Ben-M opened this Issue Oct 20, 2011 · 18 comments

Comments

Projects
None yet
9 participants
@Ben-M
Contributor

Ben-M commented Oct 20, 2011

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:
[DEPRECATION WARNING] Nested I18n namespace lookup under "activerecord.attribute s.order" is no longer supported

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
...create stuff...
...run bundle install...
Your bundle is complete! Use bundle show [gemname] to see where a bundled gem
is installed.

C:\Sites>cd spree

C:\Sites\spree>komodo Gemfile
[add gem 'spree']

C:\Sites\spree>bundle install
Using rails (3.1.1)
Using spree_core (0.70.1)
Using spree_auth (0.70.1)
Using spree_api (0.70.1)
Using spree_dash (0.70.1)
Using spree_promo (0.70.1)
Using spree_sample (0.70.1)
Using spree (0.70.1)

Your bundle is complete! Use bundle show [gemname] to see where a bundled gem
is installed.

C:\Sites\spree>rails g spree:site
[DEPRECATION WARNING] Nested I18n namespace lookup under "activerecord.attribute
s.order" is no longer supported

C:\Sites\spree>bundle exec rake spree_sample:load
[DEPRECATION WARNING] Nested I18n namespace lookup under "activerecord.attribute
s.order" is no longer supported

C:\Sites\spree>rake db:bootstrap
This task will destroy any data in the database. Are you sure you want to
continue? [y/n] y
db/development.sqlite3 already exists
...a bunch of migrations...
== CreatePromotionActionLineItems: migrating =================================
-- create_table("promotion_action_line_items")
-> 0.0030s
== CreatePromotionActionLineItems: migrated (0.0050s) ========================

Load Sample Data? [y/n]: y
Bootstrap Complete.

@suzi2000

This comment has been minimized.

Show comment
Hide comment
@suzi2000

suzi2000 Nov 3, 2011

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)
I think in the long run it would be easier to install ubuntu and enjoy how rails and rspec run 5 to 10x faster, and your system boots in like 5 seconds instead of 5 minutes xD

suzi2000 commented Nov 3, 2011

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)
I think in the long run it would be easier to install ubuntu and enjoy how rails and rspec run 5 to 10x faster, and your system boots in like 5 seconds instead of 5 minutes xD

@aew

This comment has been minimized.

Show comment
Hide comment
@aew

aew Nov 11, 2011

I am getting exactly the same behaviour on Windows 7 as Ben. Any suggestions on how to load the sample data on Windows?

aew commented Nov 11, 2011

I am getting exactly the same behaviour on Windows 7 as Ben. Any suggestions on how to load the sample data on Windows?

@Ben-M

This comment has been minimized.

Show comment
Hide comment
@Ben-M

Ben-M Nov 12, 2011

Contributor

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
faster, however delveoping on anything but Windows is a little tricky
for work projects.

Thanks for your time.

On 2 November 2011 20:13, Suzi
reply@reply.github.com
wrote:

did you gem install spree ?

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)
I think in the long run it would be easier to install ubuntu and enjoy how rails and rspec run 5 to 10x faster

Reply to this email directly or view it on GitHub:
#711 (comment)

Contributor

Ben-M commented Nov 12, 2011

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
faster, however delveoping on anything but Windows is a little tricky
for work projects.

Thanks for your time.

On 2 November 2011 20:13, Suzi
reply@reply.github.com
wrote:

did you gem install spree ?

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)
I think in the long run it would be easier to install ubuntu and enjoy how rails and rspec run 5 to 10x faster

Reply to this email directly or view it on GitHub:
#711 (comment)

@radar

This comment has been minimized.

Show comment
Hide comment
@radar

radar Nov 14, 2011

Member

Could you explain further what went wrong here? I don't see a problem in that initial post.

Member

radar commented Nov 14, 2011

Could you explain further what went wrong here? I don't see a problem in that initial post.

@aew

This comment has been minimized.

Show comment
Hide comment
@aew

aew Nov 14, 2011

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.

aew commented Nov 14, 2011

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.

@radar

This comment has been minimized.

Show comment
Hide comment
@radar

radar Nov 14, 2011

Member

Alright, what happens if you run it as rake db:bootstrap AUTO_ACCEPT=1? That shouldn't prompt for bootstrapping, but rather auto accept. Trying to work out if it's a problem with Spree or the prompter.

Member

radar commented Nov 14, 2011

Alright, what happens if you run it as rake db:bootstrap AUTO_ACCEPT=1? That shouldn't prompt for bootstrapping, but rather auto accept. Trying to work out if it's a problem with Spree or the prompter.

@aew

This comment has been minimized.

Show comment
Hide comment
@aew

aew Nov 14, 2011

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 %>
10:

All Products


11:

    12: <% Taxonomy.where(:name => "Categories").first.root.children.each_with_index do |taxon,i| %>
    13:
  • <%= raw link_to(taxon.name, seo_url(taxon)) %>

  • 14: <% end %>
    15:

I just added the spree gem to my gemfile (I did not do gem install) if that helps.

aew commented Nov 14, 2011

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 %>
10:

All Products


11:

    12: <% Taxonomy.where(:name => "Categories").first.root.children.each_with_index do |taxon,i| %>
    13:
  • <%= raw link_to(taxon.name, seo_url(taxon)) %>

  • 14: <% end %>
    15:

I just added the spree gem to my gemfile (I did not do gem install) if that helps.

@radar

This comment has been minimized.

Show comment
Hide comment
@radar

radar Nov 15, 2011

Member

Ok then, what about just running rake spree_sample:load by itself. What does that do?

Member

radar commented Nov 15, 2011

Ok then, what about just running rake spree_sample:load by itself. What does that do?

@Ben-M

This comment has been minimized.

Show comment
Hide comment
@Ben-M

Ben-M Nov 15, 2011

Contributor

The only output is a deprecation warning:

C:\Sites\spree>bundle exec rake spree_sample:load[DEPRECATION WARNING]
Nested I18n namespace lookup under "activerecord.attributes.order" is
no longer supported

On 15 November 2011 02:46, Ryan Bigg
reply@reply.github.com
wrote:

Ok then, what about just running rake spree_sample:load by itself. What does that do?


Reply to this email directly or view it on GitHub:
#711 (comment)

Contributor

Ben-M commented Nov 15, 2011

The only output is a deprecation warning:

C:\Sites\spree>bundle exec rake spree_sample:load[DEPRECATION WARNING]
Nested I18n namespace lookup under "activerecord.attributes.order" is
no longer supported

On 15 November 2011 02:46, Ryan Bigg
reply@reply.github.com
wrote:

Ok then, what about just running rake spree_sample:load by itself. What does that do?


Reply to this email directly or view it on GitHub:
#711 (comment)

@tgreider

This comment has been minimized.

Show comment
Hide comment
@tgreider

tgreider Nov 17, 2011

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.

tgreider commented Nov 17, 2011

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.

@imjp

This comment has been minimized.

Show comment
Hide comment
@imjp

imjp Nov 23, 2011

bah :( No love for the Windows users.

imjp commented Nov 23, 2011

bah :( No love for the Windows users.

@radar

This comment has been minimized.

Show comment
Hide comment
@radar

radar Nov 23, 2011

Member

We have no Windows computers to test this on, otherwise we would fix it. If you have a Windows computer, please investigate a fix for this issue.

It's not that we don't like Windows users. That is not the case at all.

Member

radar commented Nov 23, 2011

We have no Windows computers to test this on, otherwise we would fix it. If you have a Windows computer, please investigate a fix for this issue.

It's not that we don't like Windows users. That is not the case at all.

@imjp

This comment has been minimized.

Show comment
Hide comment
@imjp

imjp Nov 23, 2011

Wow that's a fast response! I'll post here if I find anything.

imjp commented Nov 23, 2011

Wow that's a fast response! I'll post here if I find anything.

@radar

This comment has been minimized.

Show comment
Hide comment
@radar

radar Nov 23, 2011

Member

Thank you, this is really appreciated!

Member

radar commented Nov 23, 2011

Thank you, this is really appreciated!

@adammidura

This comment has been minimized.

Show comment
Hide comment
@adammidura

adammidura Dec 7, 2011

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.

adammidura commented Dec 7, 2011

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.

@radar

This comment has been minimized.

Show comment
Hide comment
@radar

radar Feb 2, 2012

Member

Fixed by #1070.

Member

radar commented Feb 2, 2012

Fixed by #1070.

@radar radar closed this Feb 2, 2012

@RameshOswal

This comment has been minimized.

Show comment
Hide comment
@RameshOswal

RameshOswal Aug 8, 2015

Hey guys i got a similar error while running rake db:seed on Ubuntu machine.
Following is the error
[WARNING] You are not setting Devise.secret_key within your application!
You must set this in config/initializers/devise.rb. Here's an example:

Devise.secret_key = "7337eb039cc302ec2c2d6f5ade14d1393d4ba7824cc7058e0faaea71fd306ea520076a1dcdeaea2689852ace1b38e159832f"
loading ruby /usr/local/rvm/gems/ruby-2.2.1/gems/spree_core-3.0.1/db/default/spree/countries.rb
rake aborted!
ActiveRecord::StatementInvalid: SQLite3::SQLException: near ",": syntax error: INSERT INTO spree_countries ("name", "iso3", "iso", "iso_name", "numcode", "states_required")

*****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

RameshOswal commented Aug 8, 2015

Hey guys i got a similar error while running rake db:seed on Ubuntu machine.
Following is the error
[WARNING] You are not setting Devise.secret_key within your application!
You must set this in config/initializers/devise.rb. Here's an example:

Devise.secret_key = "7337eb039cc302ec2c2d6f5ade14d1393d4ba7824cc7058e0faaea71fd306ea520076a1dcdeaea2689852ace1b38e159832f"
loading ruby /usr/local/rvm/gems/ruby-2.2.1/gems/spree_core-3.0.1/db/default/spree/countries.rb
rake aborted!
ActiveRecord::StatementInvalid: SQLite3::SQLException: near ",": syntax error: INSERT INTO spree_countries ("name", "iso3", "iso", "iso_name", "numcode", "states_required")

*****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

@shilpi230

This comment has been minimized.

Show comment
Hide comment
@shilpi230

shilpi230 Dec 8, 2015

It happens because of your database encoding some countries has special alphabets characters. You need to change the database encoding to utf8mb4

shilpi230 commented Dec 8, 2015

It happens because of your database encoding some countries has special alphabets characters. You need to change the database encoding to utf8mb4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment