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 trialBen Anggoro
36,161 PointsEverything is OK, but the bootstrap css is not loading anymore?
Hello everyone,
I'm continuing the treebook course to the "building social features". I've followed along, everything is fine, all test passes but something weird when i start the rails server - seems like everything is working but no css is loaded.
Has anyone had ever this kind of problem? So weird. Before this step everything was fine. What on this stage could possibly cause this?
I don't get it. Could anyone help please
Thanks! Ben
12 Answers
minzawmra
Courses Plus Student 15,682 PointsHahaha, simple forms. It's actually a compatibility problem with bootstrap rather than with rails 4. Last I checked (in February/march) there was no update to it. So, you cannot use it to its full extent with bootstrap 3 (unless there's an update; I stopped on treebook temporarily in March while pursuing other courses and resumed only recently to finish off treebook). In my own project, I want to use simple forms but I decided not to because of the aforementioned reason. So, I just use the bootstrap code directly. Simple forms give you convenience methods for sure but you can live without them. Using bootstrap code directly gives you complete control anyway.
My treebook github: https://github.com/kinnik/treebook
minzawmra
Courses Plus Student 15,682 PointsIs this on your development environment or on Heroku?
Ben Anggoro
36,161 PointsHi Minzawmra,
Thanks for your reply. It's in my development environment.
I finally also tried to download the very last project file of the lesson but still same, not loading the bootstrap. Everything works fine, although there are some failures that I don't get on the final stage -- but I know it works cause I did a cheat by harcoding the bootstrap css to the html then run the server - I don't know what else to do about it - but it does work.
Does it have anything to do with ruby or rails version?
minzawmra
Courses Plus Student 15,682 PointsI did have some problems when deploying to Heroku. It was resolved by following the instructions here: https://devcenter.heroku.com/articles/getting-started-with-rails4#heroku-gems They did mention that it was related to Rails 4.
I didn't face this in my development environment. Are you on Rails 4 or 3? I was using Rails 4 throughout. Are you using Bootstrap 3 (the latest version) or Bootstrap 2? It sounds like the CSS files could not be found.
Where is your bootstrap.css file in? app/assets/stylesheets? Does your application.css file have: *= require_self *= require_tree .
Ben Anggoro
36,161 PointsTurned out I was on rails 3.2.6 I'm not too sure how it's not 4 maybe because I ended up re-installing mavericks and xcode following brew doctor recommendations. But at that time I've installed the 4.1.4 cause now that I'm doing that again, I remember I've read that 'Installing ri documentation for rails-4.1.4' before.
How could this happen? How do I end up using 3.2.6 without I even realize it? :D
Should there be some sort of dash dash something when creating the app that the video doesn't tell you? Like rails new treebook dash something Could this be the issue?
Ben Anggoro
36,161 PointsBut how did I even manage to complete odot with no problem? I didn't even realize the rails server I was on and I think this course is even older than odot. Eh? I dont get it.
Would you recommend a good reference to start rails? I found here is quite confusing. No, it's not me, I believe it's the videos. Lol
Ben Anggoro
36,161 PointsOK it's just finished installing rails 4.1.4 the terminal said that but when I type rails -v it shows rails 3.2.6 Why? How?
Ben Anggoro
36,161 PointsOh ok. I've totally misunderstood the whole idea. *Just reading rails' documentation about it again. I think I'm just gonna pass treebook and move on. I don't know what is it about the thing that I just don't get. Or maybe will actually get it after I move on.
minzawmra
Courses Plus Student 15,682 PointsYou can have multiple versions of Rails installed and can specify which version to use. That's probably what happened. I can't remember the exact video but there was one which tells you how to switch versions.
Yes, the videos for treebook are in Rails 3. They are about a year to 18 months old. Rails 4 introduced pretty drastic changes in some areas. I used Rails 4 because I wanted to build my project in Rails 4. I didn't want to learn something outdated and then learn to setup Rails 4 afterwards. Be warned: following treebook using Rails 4 isn't a smooth road. I had to google, stack-overflow and debug often to get things running smoothly. Once I got these issues sorted, it was straight forward to develop my project using Rails 4. I've just managed to complete it and have put my code using Rails 4 on GitHub.
Ben Anggoro
36,161 PointsHi minzawmra
Thank you!!! Finally i know I'm not crazy or that dumb haha! I agree sometimes - no actually many times - lots and lots of problem and the more I try to check by re-run the video the more I got confused. I think it's better to remove these videos cause so much headache. One year is too old for rails!
Just one more question, how did you manage to run treebook on rails 4? I'm stuck when bundling with one of the gems that is not compatible - i think it's simpleform? Did you finally get that to work with rails 4 or did you replace it with other gem?
minzawmra
Courses Plus Student 15,682 PointsI agree with you that the videos are sometimes confusing. I persevered because as far as treebook is concerned, it is a very cool project. Even if the staff cannot update the videos (which I understand is a lot of work), they should put notes for rails 4 users or source code with modifications for rails 4.
Ben Anggoro
36,161 PointsOh I see so you started the whole thing. Which I did, actually and everything was fine until I decided to back to the video then next thing i know the bootstrap is gone lol. Thanks I will definitely look up your git on this project. It is, actually kind of cool project. I should do the same. Don't follow the videos, but watch them as reference only.
I remember now simple form is that thing that is suppose to refactor forms isn't it? For me It turned out to be confusing so kind of glad we dont really have to use it.
But it's kind of too complex to be labeled as 'Beginner' course, don't u think? I think for subject as complex as rails we need to start with something very basic to understand how it works, first, rather than worrying too much about bootstrap and javascript and all that already. I like the way on Active Records course. For me everything start to make sense after I follow Hampton's steps to create Hamblog in the beginning of the course. Before that I had done all the previously published rails courses (incl. treebook and started the odot) but none make any sense to me, as a beginner.
Anyway thanks again! Feels much better now about rails :)