spree_fancy icon indicating copy to clipboard operation
spree_fancy copied to clipboard

Heroku compatibility

Open Maxim-Filimonov opened this issue 12 years ago • 5 comments

It seems there is a problem with latest version of the gem and deployment to heroku. https://github.com/Compass/compass-rails/issues/19 One of workaround is to set

config.assets.initialize_on_precompile = false

However, it doesn't work with spree initialisers. And it doesn't look like compass-rails & compass are inside assets group either...

Maxim-Filimonov avatar Dec 26 '12 09:12 Maxim-Filimonov

Can you please write compleate guide to reproduce this bug by steps. Thanks!

oleksify avatar Jan 28 '13 10:01 oleksify

I have created a sample repo https://github.com/Maxim-Filimonov/spree_fancy_issue_2_sample Read commits for details. Basically it's an empty rails app with spree and spree fancy installed via gemfile. The only non standard thing it that I removed the spree_fancy migrations because it's not easy to run them as part of db migrate on heroku. To test it clone the repo then do the following

heroku create
git push heroku master
heroku run rake db:bootstrap

If you try to access the app on in your browser using heroku open command. You will get an error. To see the error run heroku logs -n 300 Somewhere in logs you should find the following

ActionView::Template::Error (store/print.css isn't precompiled):

Let me know if you need more info on any step.

Maxim-Filimonov avatar Jan 29 '13 13:01 Maxim-Filimonov

I was able to resolve this by adding the line config.assets.precompile += %w( store/print.css ) to application.rb, so it should look like:

config.assets.initialize_on_precompile = false
config.assets.precompile += %w( store/print.css )

and then just precompile the assets locally:

RAILS_ENV=production bundle exec rake assets:precompile

and then it should deploy to Heroku.

mikechau avatar Feb 09 '13 18:02 mikechau

Then you need to precompile assets before you deploy every time you change them. Yes, I can do a rake task for this but I would rather avoid it and precompile on heroku side. On 10/02/2013, at 5:34 AM, Michael Chau [email protected] wrote:

I was able to resolve this by adding the line config.assets.precompile += %w( store/print.css ) to application.rb, so it should look like:

config.assets.initialize_on_precompile = false config.assets.precompile += %w( store/print.css ) and then just precompile the assets locally:

RAILS_ENV=production bundle exec rake assets:precompile and then it should deploy to Heroku.

— Reply to this email directly or view it on GitHub..

Maxim-Filimonov avatar Feb 10 '13 07:02 Maxim-Filimonov

gem 'spree_fancy', :github => 'spree/spree_fancy', :branch => '1-3-stable'

I had to add this precompile line to the production.rb, works without having to precompile locally.

config.assets.precompile += %w( store/shared/_print.css )

aaronzdavis avatar Apr 29 '13 02:04 aaronzdavis