Heroku *.js isn't precompiled error

那年仲夏 提交于 2019-12-09 15:10:31

问题


I'm using Rails on Heroku Cedar stack and it's not throwing any issues while compiling the assets but then I get a 500 internal server error:

2012-06-25T23:22:59+00:00 app[web.1]: ActionView::Template::Error (bootstrap-datepicker.js isn't precompiled):

Any idea what might be causing this? This is the javascript file I'm including (except I downloaded it locally) https://github.com/eternicode/bootstrap-datepicker/blob/master/js/bootstrap-datepicker.js

I'm including it in my application.html.erb like so:

<%= javascript_include_tag "bootstrap-datepicker" %>

Is it because its not a coffeescript file? Any help is appreciated!


回答1:


I figured it out. I had to add it to production.rb in config.assets.precompile

In production.rb I added it to my config.assets.precompile:

config.assets.precompile += %w( jquery.dataTables.min.js jquery-ui-1.8.21.custom.min.js jquery-ui-1.8.21.custom.css bootstrap-datepicker.js fullcalendar.js)


来源:https://stackoverflow.com/questions/11198856/heroku-js-isnt-precompiled-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!