【问题标题】:Bootstrap date-picker image assets not displaying when deployed (on Heroku)Bootstrap 日期选择器图像资产在部署时不显示(在 Heroku 上)
【发布时间】:2015-03-31 21:07:32
【问题描述】:

我正在使用gem 'bootstrap3-datetimepicker-rails', '~> 3.1.3' 在我的网络应用程序中包含一个日期/时间选择器,它在开发中工作,但是当我部署到 Heroku 时,gem 用于向上/向下箭头和其他的资产(图标)图标显示为空方块,如下图所示:

知道为什么这些显示正确吗?

它应该是这样的:

我正在使用 Rails 4、Ruby 2,并且部署在 Heroku 上,谢谢!

更新:查看 Heroku 日志后,我看到此错误:

ActionController::RoutingError (No route matches [GET] "/assets/bootstrap/glyphicons-halflings-regular.tttf")

在我的应用程序中,我有 "/assets/bootstrap/glyphicons-halflings-regular-0469longseriesoflettersandnumbers.tttf"),这就是它找不到它的原因。这些字母/数字是什么意思?我可以安全地从 Sublime Text 中的文件名中删除它们吗?再次感谢

【问题讨论】:

  • 您是否为生产预编译了资产?
  • 是的,我在部署之前预编译了资产。我只是重新预编译和重新部署,看起来还是一样。
  • @Beartech 刚刚添加了一些细节,如果有帮助的话,再次感谢

标签: ruby-on-rails ruby twitter-bootstrap heroku bootstrap-datetimepicker


【解决方案1】:

Glyphicon works locally but not on Herokuhttps://holarails.wordpress.com/2014/04/03/problem-twitter-bootstrap-glyphicons-not-show-in-heroku/ 找到答案。

如果有人有更好的解决方案(因为看起来使用它会影响性能),我将不胜感激!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-09-12
    • 2013-10-08
    • 1970-01-01
    • 2020-03-11
    • 2017-05-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多