简体   繁体   English

在配置asset_sync gem时使用Rails Initializer时如何设置AssetSync.config.run_on_precompile

[英]How to set AssetSync.config.run_on_precompile when using Rails Initializer in configuring asset_sync gem

How do I set AssetSync.config.run_on_precompile = false when I'm using Rails Initializer to configure asset_sync gem in Rails 3? 当我使用Rails Initializer在Rails 3中配置asset_sync gem时,如何设置AssetSync.config.run_on_precompile = false

When I run 我跑的时候

bundle exec rake assets:clean --trace

I get an error that says: 我收到一条错误消息:

** Invoke assets:clean:all (first_time)
** Invoke assets:cache:clean (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
rake aborted!
undefined method `run_on_precompile=' for #

I have also used assets_sync gem in my project recently and i didnt use AssetSync.config.run_on_precompile = false this is used in rake task. 我最近在我的项目中也使用了assets_sync gem,我没有使用AssetSync.config.run_on_precompile = false这在rake任务中使用。

If you want to set run_on_precompile = false you can set it to false in your config/enviroments/production.rb like this 如果要设置run_on_precompile = false ,可以在config/enviroments/production.rb中将其设置为false,如下所示

config.assets.initialize_on_precompile = false

For complete details on assets_sync implementation you can check this links 有关assets_sync实现的完整详细信息,您可以查看此链接

assets_sync assets_sync

heroku +assets_sync heroku + assets_sync

Still if any error persists then let me know 如果仍有任何错误,请告诉我

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM