Skip to content

"File to import not found or unreadable: store/variables" in sandbox (potential solution included) #1649

Closed
laspluviosillas opened this Issue Jun 7, 2012 · 20 comments

9 participants

@laspluviosillas

After this commit, when generating a new sandbox site and running the server, I get the following issue:

"File to import not found or unreadable: store/variables"

Changing the bundler require command on config/application.rb:5 from:

Bundler.require(*Rails.groups)

to:

Bundler.require(*Rails.groups(:assets => %w(development test)))

Fixes the issue, but to be honest I'm not entirely sure why this works, so I'm not going to issue a pull request as I don't know what other repercussions this line change could cause. Obviously, the issue is related to sprockets and the asset pipeline.

@radar
Spree Commerce member
radar commented Jun 12, 2012

I'm getting this also inside the dummy application (which is what the sandbox uses) when I run the tests, so that makes sense. Looking into it right now.

@brentertz

I am having the same issue when deploying to Heroku. olivierbuffon's solution below works well though. I had forgotten about that setting - thanks!

@olivierbuffon

Adding "config.assets.initialize_on_precompile = false" tu my application.rb solved the problem for me (I'm using spree on heroku)

@radar
Spree Commerce member
radar commented Jun 21, 2012

As far as I know this is fixed now. I'm no longer geting it in the dummy app.

@radar radar closed this Jun 21, 2012
@nikolas
nikolas commented Aug 24, 2012

I'm running into this issue in Spree, deployed to my own production server. I have both Bundler.require(*Rails.groups(:assets => %w(development test))) and config.assets.initialize_on_precompile = false in my application.rb.

@radar
Spree Commerce member
radar commented Aug 24, 2012

@nikolas Can you provide exact steps to reproduce this issue please?

@radar radar reopened this Aug 24, 2012
@sbounmy
sbounmy commented Aug 25, 2012

having the same issue on a fresh dummy app : https://github.com/sbounmy/spree_minicart & spree_core 1.1.3

@radar
Spree Commerce member
radar commented Sep 8, 2012

Are you still able to reproduce this issue?

@laspluviosillas

I'm almost certain it has to do with the rails version you're running and use to generate your new rails application. I'll run a test myself and see what I can find.

@radar
Spree Commerce member
radar commented Sep 9, 2012
@crystalneth

Same here on a new app deployed to heroku. Using this gem https://github.com/aliix/spree-heroku, which might be part of the problem. Rails 3.2.8 and Spree 1.2.0

@radar
Spree Commerce member
radar commented Sep 15, 2012
@nikolas
nikolas commented Sep 15, 2012

Can you stop emailing me

@radar
Spree Commerce member
radar commented Sep 15, 2012
@laspluviosillas
@JDutil JDutil added a commit to JDutil/spree that referenced this issue Sep 19, 2012
@JDutil JDutil Update extension development dependencies. [Fixes #1649] ecc0c56
@JDutil
Spree Commerce member
JDutil commented Sep 19, 2012

@laspluviosillas I ran into this issue as well. In your application.rb file you do want:

Bundler.require(*Rails.groups(:assets => %w(development test)))

Then in your gemspec you want to make sure your including sass-rails and coffee-rails otherwise importing 'store/variables' fails. So I have the following development dependencies added to the gemspec to fix the sandbox issue:

  s.add_development_dependency 'capybara', '~> 1.1.2'
  s.add_development_dependency 'coffee-rails'
  s.add_development_dependency 'factory_girl', '~> 3.6'
  s.add_development_dependency 'ffaker'
  s.add_development_dependency 'rspec-rails',  '~> 2.9'
  s.add_development_dependency 'sass-rails'
  s.add_development_dependency 'sqlite3'
@crystalneth

This was actually resolved for me after moving config.assets.initialize_on_precompile = false to the correct place in application.rb (vs production.rb)

@radar radar closed this in bd0fd51 Sep 24, 2012
@sbounmy
sbounmy commented Oct 12, 2012

Have anyone tried to run integration test within an extension ?
'File to import not found or unreadable: store/variables' keeps showing up...

rails server works well in spec/dummy...
https://github.com/sbounmy/spree_store_credits/tree/1-2-stable

@sbounmy
sbounmy commented Oct 12, 2012

@jdutil thanks it fixes the issue, hope it get merged quickly !

@darrencauthon

Thanks guys, this thread was a big help for my own issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.