Question

I am working through Michael Hartl's Rails tutorial, and after including a bootstrap gem I cannot get the formatting to work when I push to Heroku. Everything looks great on localhost:3000.

Here's my gemfile:

source 'https://rubygems.org'
ruby '1.9.3'
#ruby-gemset=railstutorial_rails_4_0

gem 'rails', '4.0.0'
gem 'bootstrap-sass', '2.3.2.0'
gem 'bcrypt-ruby', '3.0.1'
gem 'faker', '1.1.2'
gem 'will_paginate', '3.0.4'
gem 'bootstrap-will_paginate', '0.0.9'

And here is the beginning of my stylesheet:

@import "bootstrap";

/* mixins, variables, etc. */

$grayMediumLight: #eaeaea;

/* universal */

Not sure if the issue is in either of these places, so here is my git repository https://github.com/ajhausdorf/sample_app

Was it helpful?

Solution

Before deploying to Heroku, you need to precompile assets:

rake assets:precompile

He explains this in Section 1.4.1 Heroku setup - Listing 1.9.

OTHER TIPS

Another alternative is to enable Rail's static asset server (in production.rb).

config.serve_static_assets = true

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top