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 Todo List Application with Rails 4 Build a Todo List Application with Rails 4 Write Our First Tests

ODOT/app/controllers/application_controller.rb:5: syntax error, unexpected keyword_end, expecting end-of-input

I get this error when I try to go to Localhost:3000 now:

ODOT/app/controllers/application_controller.rb:5: syntax error, unexpected keyword_end, expecting end-of-input

This is the code from there:

sclass ApplicationController < ActionController::Base
  # Prevent CSRF attacks by raising an exception.
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :exception
end

1 Answer

William Li
PLUS
William Li
Courses Plus Student 26,868 Points

umm ... Ruby has keyword the class, there's no sclass.

Thanks, I must have just hit a key by accident and I never noticed because I didn't think I had ever edited that file.

William Li
William Li
Courses Plus Student 26,868 Points

yes, I'm sure, sometimes I accidentally hit a key on my keyboard and add a character somewhere on the code and caused me endless troubles. It's normal, glad that the error message provided here is super helpful.