I've been following the RailsTutorial.org book (I'm at Ch. 6) and had no problem making a page appear on 'localhost:3000', was able to edit the html.erb files and css to my heart's content...then suddenly, I receive an error in terminal:
ActionController::RoutingError (undefined local variable or method
test_helper' for main:Object):app/controllers/static_pages_controller.rb:1:in
'
As well as a, "We're sorry, but something went wrong." on localhost.
What can I do to get this back up and running?
You should remove require test_helper
from the file app/controllers/static_pages_controller.rb . That line should only be into your tests since it is a helper designed for tests. And especially into the tests/models/user_test.rb file since you're on Chapter 6.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.