NameError: main:Object的未定义局部变量或方法“params”

时间:2021-07-04 23:53:36

I'm using carrier wave and i get

我用的是载波

NameError: undefined local variable or method `params' for main:Object

when i do u.commentfile = params[:file]

当我做u.commentfile = params[:file]

in the console? help!

在控制台?的帮助!

1 个解决方案

#1


4  

The error is telling you exactly what's wrong. In the console, you're not in the scope of a request, so the params variable isn't defined unless you've done so manually. What are you trying to do?

错误就是告诉你到底出了什么问题。在控制台中,您不在请求范围内,所以除非您手动定义params变量,否则不会定义params变量。你想做什么?

#1


4  

The error is telling you exactly what's wrong. In the console, you're not in the scope of a request, so the params variable isn't defined unless you've done so manually. What are you trying to do?

错误就是告诉你到底出了什么问题。在控制台中,您不在请求范围内,所以除非您手动定义params变量,否则不会定义params变量。你想做什么?