简体   繁体   English

水豚的访问方法返回:NoMethodError:值为true的未定义方法“ to_i”:TrueClass

[英]Capybara's visit method returns : NoMethodError: undefined method `to_i' for true:TrueClass

I'm trying to go through the confirmation process : 我正在尝试通过确认过程:

request_url = "/users/confirmation?confirmation_token=azq32soznE1xuSWLjBat"

Then when I do : 然后,当我这样做时:

visit request_url

It returns : 它返回:

NoMethodError: undefined method `to_i' for true:TrueClass

I thought, originally, that this was Devise, but it doesn't hit any of my debuggers so it never even makes it there. 我本来以为这是Devise,但它没有打到我的任何调试器,所以它甚至都没有出现过。 What's even more puzzling was that I made no adjustments to this area of my app, so I'm very confused as to how this suddenly arose. 更加令人困惑的是,我没有对应用程序的这一区域进行任何调整,因此我对如何突然出现这种情况感到非常困惑。

Any ideas on how to debug this? 关于如何调试的任何想法?

My guess is the confirmation token doesn't exist. 我的猜测是确认令牌不存在。 Look at the code surrounding the error, you have something that is saying 查看错误周围的代码,您有句话在说

my_variable = true
my_variable.to_i

You're calling .to_i somewhere on a boolean, which is no good. 您在布尔值的某个地方调用.to_i ,这不好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Capybara NoMethodError:未定义的方法`visit&#39;for - Capybara NoMethodError: undefined method `visit' for NoMethodError(未定义方法`persisted?&#39;为true:TrueClass) - NoMethodError(undefined method `persisted?' for true:TrueClass) NoMethodError(未定义的方法`validate&#39;为true:TrueClass) - NoMethodError (undefined method `validate' for true:TrueClass) NoMethodError:true的未定义方法“ errors”:TrueClass - NoMethodError: undefined method `errors' for true:TrueClass NoMethodError(未定义的方法 `last' 为 true:TrueClass): - NoMethodError (undefined method `last' for true:TrueClass): undefined方法&#39;&lt;&lt;&#39;为true:TrueClass - undefined method `<<' for true:TrueClass true的未定义方法[[]”:TrueClass - undefined method `[]' for true:TrueClass NoMethodError:未定义的方法“ map”为true:TrueClass用于映射标头/创建CSV - NoMethodError: undefined method `map' for true:TrueClass for mapping headers/creating CSVs Rails 4错误:NoMethodError true的未定义方法“ to_model”:TrueClass - Rails 4 Error: NoMethodError undefined method `to_model' for true:TrueClass 连接失败:domain.com(NoMethodError:未定义的方法“&gt;”为true:TrueClass) - connection failed for: domain.com (NoMethodError: undefined method `>' for true:TrueClass)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM