【问题标题】:twitter-bootstrap icons do not appear in herokutwitter-bootstrap 图标不会出现在 heroku 中
【发布时间】:2013-05-23 21:24:10
【问题描述】:

我正在使用 ruby​​ 2.0.0 开发 Rails 4 应用程序。我使用 twitter-bootstrap,但图标字形有问题:http://twitter.github.io/bootstrap/base-css.html#icons 问题是这些图标不会出现在生产中。在开发环境中,一切正常。

这是我在 help.html.erb 文件中的代码

<i class="icon-user"></i>

我的 gemfile 包含以下行:

gem 'bootstrap-sass', '2.3.1.0'

我的生产环境部署在 heroku 上。 你知道为什么这些图标没有出现吗?感谢您的帮助。

【问题讨论】:

  • 我通过直接从 glyphicons.com 下载图标图像,将它们放入 app/assets/images,将 config.serve_static_assets 设置为 true,运行 rake assets:precompile 并推送到 heroku 来解决了这个问题。

标签: twitter-bootstrap heroku icons


【解决方案1】:

我解决了这个问题,直接从 glyphicons.com 下载图标图像,将它们放入 app/assets/images,将 config.serve_static_assets 设置为 true,运行 rake assets:precompile,然后推送到 heroku。

【讨论】:

    【解决方案2】:

    我遇到了同样的问题。

    尝试运行以下命令:

    RAILS_ENV=production rake assets:clean and
    RAILS_ENV=production rake assets:precompile.
    

    这对我有用。

    【讨论】:

      猜你喜欢
      • 2013-11-01
      • 1970-01-01
      • 2021-01-15
      • 2015-06-21
      • 1970-01-01
      • 2012-07-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多