【发布时间】:2012-05-20 23:37:15
【问题描述】:
我开始使用asset_sync gem in order to use Amazon S3 as a CDN asset host(我正在使用 Heroku 和 RoR)。我的所有资产都正确加载,除了我通过 Twitter Bootstrap 使用的图标(图标应该在的地方只有一个空白)。
我尝试使用 Heroku 的多资产预处理器支持:
app/assets/stylesheets/custom.css.scss.erb
background-image: url(<%= asset_path "../img/glyphicons-halflings.png"%>);
我还尝试将 glyphicons-halflings.png 直接移动到 images 文件夹并在那里引用它:
app/assets/stylesheets/custom.css.scss.erb
background-image: url(<%= asset_path "/assets/glyphicons-halflings.png"%>);
app/assets/stylesheets/custom.css.scss
background-image: url("/assets/glyphicons-halflings.png");
但是,我还没有找到让它工作的方法。任何关于如何让 Twitter Bootstrap 图标成功地与 S3/Heroku 一起工作的建议将不胜感激。
编辑:我正在使用:gem 'bootstrap-sass', '~> 2.0.2'
【问题讨论】:
标签: ruby-on-rails-3 heroku amazon-s3 icons twitter-bootstrap