My background links and glyphicons stopped working on Heroku

Although all my background images and glyphicons are showing correctly on my localhost, they stopped working after my last boot to Heroku. All other images are displayed correctly.

My background images are defined by custom.css.scss as background-image: data-data-url ('bg-nav-dark.png'); I also tried Background Image: URL ('BG-nav.png');

My glyphicons in bootstrap.css are defined as:

@font-face {
  font-family: 'Glyphicons Halflings';
  src: font-url('glyphicons-halflings-regular.eot');
  src: font-url('glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), etc.

      

When I check my home page on Heroku, the console sees these errors:

GET https://peaceful-harbor-2916.herokuapp.com/assets/bootstrap.css.map 404 (Not Found) peaceful-harbor-2916.herokuapp.com/:11 
GET https://peaceful-harbor- 2916.herokuapp.com/assets/bootstrap.css.map 404 (Not Found) application-a29ac562c89a1c46b8f0515885102bda.js:3509 
GET https://peaceful-harbor-2916.herokuapp.com/assets/bg-texture.png 404 (Not Found) application-a29ac562c89a1c46b8f0515885102bda.js:3509 
GET https://peaceful-harbor-2916.herokuapp.com/assets/bg-nav.png 404 (Not Found) application-a29ac562c89a1c46b8f0515885102bda.js:3509 
GET https://peaceful-harbor-2916.herokuapp.com/fonts/glyphicons-halflings-regular.woff application-a29ac562c89a1c46b8f0515885102bda.js:3509 

      

etc .. and others.

(The above lines give me an idea that precompiling puts assets in places where Rails can't find them afterwards) After pushing my code to Heroku, I precompile and get this response:

$ heroku run rake assets:precompile Running `rake
assets:precompile` attached to terminal... up, run.3123 rake aborted!
Sass::SyntaxError: Invalid CSS after "...":3,"sources":[": expected
"|", was ""bootstrap.css"..."   (in /app/app/assets/stylesheets/application.css)

      

I save my images and fonts in these folders:

/app
  /assets
    /fonts
    / images
    / stylesheets   

      

I don't know why, but precompilation results in images in path / public / assets

In application.rb I have the following lines:

config.assets.initialize_on_precompile = true  # I have tried false as well
config.i18n.enforce_available_locales = false
config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')]
config.i18n.default_locale = :en
config.assets.paths << Rails.root.join("app", "assets")
config.assets.paths << Rails.root.join("app", "assets", "fonts")
config.assets.paths << Rails.root.join("app", "assets", "images")

      

My production.rb contains config.serve_static_assets = true

My application.css contains:

/*
 *= require jquery-ui/datepicker
 *= require_self
 *= require bootstrap
 *= require 'custom'
 *= require leaflet
 *= require_tree .
 */

      

Here is my Gemfile:

source 'https://rubygems.org'
source 'http://gemcutter.org'
source 'https://rails-assets.org'
gem 'rails', '4.1.7'
gem 'haml-rails'
gem 'bootstrap-sass', '~>3.2.0'
gem 'rails-assets-bootstrap'
gem 'rails-assets-leaflet'
gem 'sass', '~>3.2.0'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails', '~> 2.3.0'
gem 'jquery-ui-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0',          group: :doc
gem 'pg'
group :development do
  gem 'spring'
  gem 'rails_12factor'
end
gem 'rake', '~> 10.3.2'
gem 'paper_trail', '~> 3.0.6'
group :test, :development do
  gem 'rspec-rails'
  gem 'sqlite3'
  gem 'simplecov'
end
group :test do
  gem 'capybara', '~> 2.4.0'
  gem 'database_cleaner', github: 'bmabey/database_cleaner'
  gem 'factory_girl_rails'
end
gem 'bcrypt', '~> 3.1.7'
ruby "2.1.4"

      

Please tell me what I am missing.

+3
twitter-bootstrap ruby-on-rails-4 heroku


source to share


No one has answered this question yet

Check out similar questions:

786
How to link a folder to an existing Heroku app
13
Glyphicon works locally, but not on Geroku
6
Uninitialized AssetSync constant
five
Bootstrap 3 Glyphicons not showing on Heroku
4
twitter-bootstrap-rails on Heroku: Glyphicons display as squares
1
Using boostrap.css file in Rails production / heroku without LESS or SASS
1
bootstrap 3 rails 4 glyphicons that don't go into production
1
Rails 4 and Asset Precompilation Does Not Precompile Local Jewel Assets
1
glyphicon font not working with bootstrap 3 and rails 4
0
bower-rails font-awesome.css not found after solution



All Articles
Loading...
X
Show
Funny
Dev
Pics