Emm*_*uel 14 css ruby-on-rails glyph heroku twitter-bootstrap
如果你在这里查看我的应用程序:http://quiet-brushlands-5712.herokuapp.com/,靠近按钮的是一个图标,一个glyphicon.但它没有出现在heroku上.在本地它显示如下:
我从这里尝试了"解决方案" 使用Rails生产中的boostrap.css文件/没有LESS或SASS以及Google中的其他链接.我也需要字形在Heroku上显示.有帮助吗?
我没有手动下载Twitter Bootstrap,我只是使用了一个gem.在我的Javascript控制台中,我有这个:
GET http://quiet-brushlands-5712.herokuapp.com/assets/glyphicons-halflings.png 404 (Not Found)
我的Gemfile如果有帮助:
source 'https://rubygems.org'
gem 'rails', '4.0.2'
gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails', '3.0.4'
gem 'turbolinks', '2.0.0'
gem 'jbuilder', '~> 1.2'
gem 'bootstrap-sass', '2.1'
gem 'jquery-ui-rails', '4.1.0'
gem 'pg'
gem 'font-awesome-rails', '4.0.3.0'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
group :development, :test do
gem 'rspec-rails', '2.11.0'
gem 'guard-rspec', '1.2.1'
gem 'guard-spork', '1.2.0'
gem 'childprocess', '0.3.6'
gem 'spork', '0.9.2'
end
group :production do
gem 'rails_12factor'
end
Run Code Online (Sandbox Code Playgroud)
Emm*_*uel 35
解决的办法是改变config.assets.compile = false
以config.assets.compile = true
中config/environments/production.rb
文件.
joe*_*di1 13
不使用编译回退的解决方案(在Rails 4.1上测试):在scss文件中,在bootstrap之前导入bootstrap-sprockets.
@import "bootstrap-sprockets";
@import "bootstrap";
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
6633 次 |
最近记录: |