1
나는이 문제의 원인을 파악하기 위해 노력하고 있습니다. 내가 내 컨트롤러에 render
의 변화를 호출하는 경우 다음과 같은 제기 호출 렌더링이 발생합니다 "실제 클래스에 대해 '정의되지 않은 메서드'logger '
NoMethodError: undefined method `logger' for true:TrueClass
from /Users/username/.rvm/gems/ruby-2.3.4/gems/activesupport-5.1.3/lib/active_support/configurable.rb:113:in `logger'
나는
active_support/configurable.rb:113을 확인하고 나는 확실히 그것을 비교를 위해 모금 무엇을 이해하지 않습니다. 나는 동일한 컨트롤러를 공유하는 다른 컨트롤러를 가지고 있는데, 이는 내가
render
일 때이 오류를 던지지 않고있다.
여기에 표시되지 않는 내용은 무엇입니까?
편집 내 응용 프로그램 컨트롤러 아래
class Device::V1::DeviceController < ApplicationController
def status
render json: { foo: 'bar' }, status: :ok
end
end
에서 렌더링 호출
class ApplicationController < ActionController::API
include ActionController::HttpAuthentication::Token::ControllerMethods
before_action :authenticate!
private
def authenticate!
authenticate_or_request_with_http_token do |token, options|
token == SECRET[:api_key]
end
end
end
레일 5.1.3
루비 2.3.4
업데이트 이 컨트롤러에는 config
이라는 메서드가 있습니다. 분명히 이것은 ActiveSupport와 충돌하는 예약 된 네임 스페이스입니다.
어디에서 전화를 걸 수 있습니까? – Cyzanfar
@Cyzanfar 업데이트 됨 – theartofbeing