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 Build a Simple Ruby on Rails Application Frontend Development Installing Twitter Bootstrap

Chase Lee
Chase Lee
29,275 Points

Trouble adding Twitter Bootstrap to my Ruby on Rails project.

Hi everyone!

I'm trying to follow along the Build a Simple Ruby on Rails Application, with Jim Hoskins. And at about 9:00 in the video he adds twitter Bootstrap to the project.

So far I have followed exactly as he said. I'm guessing it's a problem with the version of Ruby or Rails that I have, (I believe that I'm using the latest version of both). Here is the error that I'm getting.

Any help is greatly appreciated.

Thank you all so much.

-Chase

8 Answers

Chase Lee
Chase Lee
29,275 Points

I figured it out by adding the styles form the bootstrap.css to the scaffold.css.scss file. Thank you both so much for your time!

Stone Preston
Stone Preston
42,016 Points

ok it may be an issue with the asset pipeline then. hmm. there is a bootstrap gem you can use. just include

gem 'bootstrap-sass', '2.3.2.0'

in your gem file and the version number you want (2.3.2 is whats used in the videos I think. then you can include the bootstrap css by including

@import "bootstrap";

at the top of your CSS file

Chase Lee
Chase Lee
29,275 Points

Just to clarify. Put it in the application.css file, right?

Create a custom.css.scss and put it in there :)

Stone Preston
Stone Preston
42,016 Points

can you post the line where you include bootstrap into your gemfile and where you include it in your css

Chase Lee
Chase Lee
29,275 Points

All I did was drag and drop like in this video.

Stone Preston
Stone Preston
42,016 Points

can you post a screen shot of your css directory?

Stone Preston
Stone Preston
42,016 Points

what version of rails are you using out of curiosity?

Try adding it this way see if it works. here section 5.1.2 incase the link doesn't move to the section. :D

Chase Lee
Chase Lee
29,275 Points

Okay. Thanks Stone Preston. That got me past the css error, but now I'm having problems with the next line. (The javascript.)