我正在尝试制作基本的HttpAuthentication请求
我输入rails c
并输入:
env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials(user,pw)
我得到一个错误
NameError: undefined local variable or method
env'代表main:Object
`
答案 0 :(得分:0)
与Deep在评论中说,请尝试将env
更改为ENV
。