Javascript 为什么当我推到heroku时,我的rails资产在资产预编译期间看起来是重复的?
我使用以下资产:Javascript 为什么当我推到heroku时,我的rails资产在资产预编译期间看起来是重复的?,javascript,ruby-on-rails,ruby,heroku,asset-pipeline,Javascript,Ruby On Rails,Ruby,Heroku,Asset Pipeline,我使用以下资产: $ ls app/assets/javascripts/ application.js jquery-1.7.2.min.js rails.js date-picker.js jquery-ui-1.8.22.custom.min.js row_shading.js default_on_first_input_field.js long_or_short_details.js
$ ls app/assets/javascripts/
application.js jquery-1.7.2.min.js rails.js
date-picker.js jquery-ui-1.8.22.custom.min.js row_shading.js
default_on_first_input_field.js long_or_short_details.js sortable_hook.js
$
$ ls app/assets/stylesheets/
application.css default.scss.css jquery-ui-1.8.22.custom.css main.css
它们在本地都可以正常工作,当我推到heroku时也可以
但我注意到,当我推到Heroku时,我看到:
是什么导致了这一数字翻了一番
jquery-1.7.2.min.js
jquery-ui-1.8.22.custom.min.js
default_on_first_input_field.js
row_shading.js
long_or_short_details.js
sortable_hook.js
date-picker.js
application.js
main.css
default.scss.css
jquery-ui-1.8.22.custom.css
我的舱单有:
$ cat app/assets/javascripts/application.js
// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
//
//= require jquery-1.7.2.min
//= require jquery-ui-1.8.22.custom.min
//= require default_on_first_input_field
//= require row_shading
//= require long_or_short_details
//= require sortable_hook
//= require date-picker
//= require_self
20:44:18 durrantm Castle2012 /home/durrantm/Dropnot/_/rails_apps/linker master
$ cat app/assets/stylesheets/application.css
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
*= require 'main'
*= require_self
*= require_tree .
*/
?
[添加:production.rb如下]
$ cat config/environments/production.rb
Linker::Application.configure do
config.cache_classes = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.serve_static_assets = false
config.assets.compress = true
config.assets.compile = false
config.assets.digest = true
config.assets.precompile += %w(default.scss.css main.css jquery-ui-1.8.22.custom.css)
config.i18n.fallbacks = true
config.active_support.deprecation = :notify
end
$
你能展示一下你的作品吗。我应该删除预编译行吗?嗯,我注释掉了预编译行,但它没有帮助…而且这只是css,只是我的1/2problem@MichaelDurrant你需要一棵树。
$ cat config/environments/production.rb
Linker::Application.configure do
config.cache_classes = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.serve_static_assets = false
config.assets.compress = true
config.assets.compile = false
config.assets.digest = true
config.assets.precompile += %w(default.scss.css main.css jquery-ui-1.8.22.custom.css)
config.i18n.fallbacks = true
config.active_support.deprecation = :notify
end
$