Search code examples
ruby-on-railstwitter-bootstrapherokubootstrap-sass

Bootstrap-sass asset compilation on Heroku deployment


I am currently working on a Rails application that uses the bootstrap-sass gem to help style some of my front end views. When running locally, I have no problem browsing the views. After Heroku deployment, I receive the following error:

ActionController::RoutingError (No route matches [GET] "/assets/bootstrap-responsive.css")

Here is a snippet of my application.rb file:

# Enable the asset pipeline
config.assets.enabled = true

# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'

config.assets.compile = true
config.assets.initialize_on_precompile = false

Any thoughts as to how to get bootstrap-sass working on a Heroku deployment with asset pre-compilation?


Solution

  • I had my bootstrap import statements in my application.css file. By moving to a bootstrap_and_overrides.css.scss file, my problem was solved.

    This post helped: Getting bootstrap-sass bootstrap CSS into production on Heroku