Rails 5开发application.js文件即使在重新启动服务器后也没有更新

时间:2017-11-03 05:59:58

标签: ruby-on-rails ruby-on-rails-5 asset-pipeline

application.js文件中的更改未反映,因为每次rails都从public / assets文件夹中选择文件。
这是我的 application.js 文件

//= require jquery
//= require jquery_ujs
//= require ./inner/jquery.min.js
//= require ./inner/sidebar-nav.min.js
//= require ./inner/jquery.slimscroll.js
//= require ./inner/waves.js
//= require ./inner/mask.js
//= require ./inner/footable-init.js
//= require ./inner/jquery.waypoints.js
//= require ./inner/jquery.counterup.min.js
//= require ./inner/raphael-min.js
//= require ./inner/morris.js
//= require ./inner/morris-data.js
//= require ./inner/owl.carousel.min.js
//= require ./inner/owl.custom.js

//= require ./inner/custom.min.js
//= require ./inner/dashboard1.js

我试过了:

rake assets:precompile

我也尝试过 development.rb

config.serve_static_assets = false

1 个答案:

答案 0 :(得分:1)

运行rake rake assets:precompile后,它将从public/assets文件夹加载资源,因此您需要删除public/assets并重新启动服务器,同时从项目目录中删除缓存rm -rf tmp/cache