Heroku * .js不是预编译错误 [英] Heroku *.js isn't precompiled error

查看:156
本文介绍了Heroku * .js不是预编译错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Heroku Cedar堆栈上使用Rails,并且在编译资产时不会抛出任何问题,但随后出现500内部服务器错误:

  2012-06-25T23:22:59 + 00:00 app [web.1]:ActionView :: Template :: Error(bootstrap-datepicker.js未预编译):

有什么想法可能导致这种情况?这是我包括的JavaScript文件(除了我本地下载) https://github.com/eternicode/bootstrap-datepicker/blob/master/js/bootstrap-datepicker.js



我是包括它在我的application.html.erb中是这样的:

 <%= javascript_include_tagbootstrap-datepicker%> 

是否因为它不是coffeescript文件?任何帮助表示赞赏!

解决方案

我想通了。我必须将它添加到config.assets.precompile中的production.rb中。

在production.rb中,我将它添加到了我的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)


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!

解决方案

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)

这篇关于Heroku * .js不是预编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆