Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Treebook is live on Heroku, but missing css styling.

Jason Seifer I have my site live on Heroku: http://blooming-temple-4543.herokuapp.com but it's missing the styling. On my local machine it works fine, and has all the css styling.

5 Answers

So, I fixed it. I literally had to add a link to bootstrap in my html. I'm still not sure why it didn't go through when I pushed. I assume that it was linked some other way with bootstrap on my local machine.

Are you using Rails 4?

The CSS and JavaScript files are pre-compiled during deployment, so they won't retain the original name. Instead they will be referenced through the assets directory. Pre-compiled files are preferred to directly linking them.

Gemfile needs to be modified for this to work on Heroku. Here's the solution: https://devcenter.heroku.com/articles/getting-started-with-rails4#heroku-gems

Dude, the deployed version isn't calling Bootstrap. Are you using bootstrap?

Yeah. I'm using bootstrap.

I checked your app. Bootstrap is NOT being included in the HTML file. Also, it appears as though neither bootstrap.css nor bootstrap.min.css are being included in the application when you deploy. How are you calling the Bootstrap files in your ERB files?

<head>
      <title>Treebook</title>
  <%= stylesheet_link_tag    "application", :media => "all" %>
  <%= javascript_include_tag "application" %>
  <%= csrf_meta_tags %>
</head>