문제가 발생했을 때 Hartl의 Ruby on Tutorial 4 장을 통해 작업하고있었습니다. full_title_helper.rb 파일을 추가 할 때까지 필자의 프로젝트는 레일즈 서버에 잘로드되었다.railstutorial.org chap 4 full_title_helper.rb로 인해 RuntimeError가 발생 함 (순환 종속성이 감지 됨 ...)
내가 얻을 :
RuntimeError에 (순환 종속성이 감지 일정 FullTitleHelper을 자동 로딩하는 동안) :
응용 프로그램/컨트롤러/application_controller.rb : 1 : '최고 (필수)'
에app/controllers/static_pages_controller.rb : 1 : '상단 (필수)'
this suggestion에 따라 config.middleware.delete Rack :: Lock을 내 development.rb 파일에 추가하려고 시도했지만 도움이되지 않았습니다.
레일 4.0.2에서 4.0.0으로 전환 해 보았습니다. 그것은 작동하지 않았다.
내 full_title_helper.rb는이 문제를 해결하기 위해 내가 할 일을 Hartl's page
module ApplicationHelper
# Returns the full title with minor modifications depending on the page
def full_title(page_title)
base_title = "Ruby on Rails Tutorial Sample App"
if page_title.empty?
base_title
else
"#{base_title} | #{page_title}"
end
end
end
에서 직접입니까?
이 질문을 무시하십시오. 이 헬퍼는 "full_title_helper.rb"가 아닌 "application_helper.rb"가되어야합니다. 파일의 이름을 변경하면 문제가 해결됩니다. – user3338765