Rails Aasa Routing Proc Lambda Git

Rails AASA 라우팅 3가지 함정: proc vs lambda, 경로 누락, git 미추적

iOS 유니버설 링크(Universal Links)를 설정하려면 /.well-known/apple-app-site-association 경로에서 JSON을 반환해야 한다. Rails에서 이걸 라우팅할 때 흔히 빠지는 함정 3가지를 정리한다. 에러 ActionController::RoutingError (No route matches [GET] "/.well-known/apple-app-site-association"): ActionController::RoutingError (No route matches [GET] "/apple-app-site-association"): 배포 서버 로그에서 이 에러가 반복되고, iOS 앱에서 유니버설 링크가 동작하지 않는다. 함정 1: proc을 Rack 앱으로 사용 Rails routes에서 inline으로 파일을 반환하려고 proc을 쓰는 경우가 있다. # 동작하지 않는 코드 get "/.well-known/apple-app-site-association", to: proc { file = Rails.root.join("public/.well-known/apple-app-site-association") [200, { "Content-Type" => "application/json" }, [File.read(file)]] } Rails 라우팅에서 to: 옵션에 Rack 앱을 직접 넣을 때는 env 인자를 받는 callable이어야 한다. proc { } 블록은 인자 없이 정의되어 있어서 Rack 인터페이스를 만족하지 못한다. ...

2025-09-03 · 2분 소요 · Seunghan
개인정보처리방침 문의