Skip to content
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

Deface precompiling in production not working #102

Open
keilmillerjr opened this issue Aug 11, 2013 · 3 comments
Open

Deface precompiling in production not working #102

keilmillerjr opened this issue Aug 11, 2013 · 3 comments

Comments

@keilmillerjr
Copy link

A while ago I made a comment on google groups about my site missing the login/account/logout links in production. I received a response 10 days later stating that it might be an issue with deface and precompiling. Upon closer notice, he was right! My deface override is not being applied. Forgive me for continuing the conversation here, but I missed his comment until now because google groups is a bit difficult for me to use.

production.rb

Disable Deface once precompiling is used to prevent overrides getting applied twice

config.deface.enabled = false

I must have overlooked or forgotten the part in the deface docs about having to precompile. So I run the precompile command to my heroku production app and get the following results.

$ heroku run rake deface:precompile --remote heroku_production
Running rake deface:precompile attached to terminal... up, run.9755
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7)

It appears that nothing happens other than the normal heroku plugin warnings that happen with everything, even if there are no plugins present.

I restart my app and there are no changes. It seems as though the precompile did not work. Do you guys have any ideas?

@keilmillerjr
Copy link
Author

A bunch of searching and I was able to find this post. I think I have to run the deface precompile command on an environment such as development where deface is enabled. So I could compile and push the new compiled_views directory to heroku. However, this causes overrides to be applied twice in an environment where deface is enabled.

How can I get spree/deface to ignore compiled_views when deface is enabled?

@paynecodes
Copy link

@keilmillerjr Any luck with this? Not having to precompile before deployment that is.

@ardelio
Copy link

ardelio commented Dec 8, 2015

@jpdesigndev for reference sake I have done the following:

# configs/environments/production.rb
config.deface.enabled = ENV['DEFACE_ENABLED'] == 'true'

in production environment, don't set that environment variable. Instead run the following rake command:

DEFACE_ENABLED=true bundle exec rake deface:precompile && rm -rf app/overrides

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants