当我运行rake assets:precompile
时,它会在日志中显示它编译plugin.js
和knockout
,但这些文件不在public/assets
中。有什么问题?
//= require jquery
//= require jquery_ujs
//= require twitter/bootstrap
//= require ckeditor/init
//= require_tree .
搜索文件:
[vagrant@localhost BK-Development]$ find public/assets -name plugin.js
[vagrant@localhost BK-Development]$ find public/assets -name knock\*
[vagrant@localhost BK-Development]$ grep plugin.js log/production.log
Compiled ckeditor/plugins/youtube/plugin.js (0ms) (pid 32556)
Compiled ckeditor/plugins/youtube/plugin.js (0ms) (pid 32556)
[vagrant@localhost BK-Development]$ grep knockout log/production.log
Compiled knockout-3.1.0.js (0ms) (pid 32556)
Compiled knockout-3.1.0.js (0ms) (pid 32556)
[vagrant@localhost BK-Development]$ grep plugin.js public/assets/manifest.yml
[vagrant@localhost BK-Development]$ grep knockout public/assets/manifest.yml
[vagrant@localhost BK-Development]$
这些都在我的production.rb
中。不应该是相关的。
config.serve_static_assets = true
config.assets.compress = true
config.assets.compile = true
config.assets.digest = true
config.assets.precompile += %w( bootstrap.modal.js bootstrap.modal.css application/_helper_classes.css
bootstrap-datepicker.js bootstrap-datepicker.css books_admin.js categories.js posts.js )
Rails 3.2.14
答案 0 :(得分:0)
我明确地将knockout-3.1.0.js
和plugin.js
添加到config.assets.precompile
,并在public/assets
中生成了文件。我仍然不知道为什么它会产生除了那些之外的所有其他JS文件。