I know this is a common issue and has been asked couple times here. I followed this method Bootstrap 3+Rails 4 - Certain Glyphicons not working it works in development and used to work in production but after working on my app in development and moving it to production it's stopped working anymore.I'm using Rails 4.2.5 on AWS ubuntu server. My assets were precompiled without errors.
Bootstrap files are placed in their appropriate directories in myapp/app/assets. My icons and background image are not working in production only.I checked my log file it shows these errors.
ActionController::RoutingError (No route matches [GET] "/stylesheets/bootstrap.css"):
ActionController::RoutingError (No route matches [GET] "/javascripts/bootstrap.js"):
ActionController::RoutingError (No route matches [GET] "/fonts/glyphicons-halflings-regular.woff2"):
etc
application.html.erb
<%= stylesheet_link_tag "bootstrap" %>
<%= javascript_include_tag "bootstrap" %>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
application.rb
config.assets.paths << "#{Rails}/app/assets/fonts"
config.assets.precompile += %w( .svg .eot .woff .ttf )
bootstrap.css
@font-face {
font-family: 'Glyphicons Halflings';
src: url('/assets/glyphicons-halflings-regular.eot');
src: url('/assets/glyphicons-halflings-regular.eot?#iefix')
format('embedded-opentype'), url('/assets/glyphicons-halflings-regular.woff')
format('woff'), url('/assets/glyphicons-halflings-regular.ttf')
format('truetype'), url('/assets/glyphicons-halflings-regular.svg#glyphicons- halflingsregular') format('svg');
application.css I renamed it to application.css.scss and still does not work. I'm not sure If I really need to rename it.
*= require_self
*= require bootstrap
*= require_tree .
application.js
//= require jquery
//= require jquery_ujs
//= require bootstrap
//= require jquery.raty
//= require ratyrate
//= require_tree .