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

Creating profiles controller: Error on test

1) Error: ProfilesControllerTest#test_should_get_show: ActionView::Template::Error: Invalid CSS after "...":3,"sources":[": expected "|", was ""less/normalize..." (in /Users/Buusmann/Work/Projects/Rails/treebook/app/assets/stylesheets/application.css) app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb__3731808740455342150_2177618980' test/controllers/profiles_controller_test.rb:5:in `block in <class:ProfilesControllerTest>'

I get the above error, just after having created the new profiles controller. Does anyone have any idea as of why this happens?

I'm using rails 4 and ruby 2.1

4 Answers

The error tells you what's wrong. It appears that there is some invalid CSS:

Invalid CSS after "...":3,"sources":[": expected "|", was ""less/normalize..." (in /Users/Buusmann/Work/Projects/Rails/treebook/app/assets/stylesheets/application.css) 

Check you application.css file, something is mistyped.

In fact, http://stackoverflow.com/questions/7679069/twitter-bootstrap-has-invalid-css-according-to-rails-3-1-asset-pipeline-during-p this here got me the final solution. It turns out that it didn't like the bootstrap.min.css file

body {
    padding-top: 40px;
}
body .nav-tabs{
    border-bottom: 0;
}
.alert{
    margin-top: 10px;
}
body .status{
    padding: 0;
}
body .post-new-status-btn{
    margin-bottom: 5px;
}
body .show-single-status{
    margin-top: 100px;
}

This is my application.css code. I can't seem to find any misspells? There is some stuff that's commented out in the top, but that shouldn't matter?

Fixed it, it was indeed the commented out stuff in the top that was acting up! Thanks a lot Brandon!

It might be in the show page for your profile, so the profiles > show.html.erb file? Maybe a mistyped "" or something.