Rails 4 - 在控制台中搜索 - 表达形式

时间:2016-04-16 02:59:08

标签: ruby-on-rails console

我试图找出如何在我的控制台中搜索。

UserOrganisationMapperService.call(User.where(email: ‘hello@trcr.com’).first)

我尝试了以上内容。这种表达形式以前对我有用,虽然现在我收到了我无法弄清楚的错误信息。

SyntaxError: (irb):7: syntax error, unexpected tIVAR, expecting keyword_do or '{' or '('
...where(email: ‘hello@trcr.com’).first)
...                               ^
(irb):7: syntax error, unexpected ')', expecting end-of-input
...ail: ‘hello@trcr.com’).first)

我已经设法弄清楚" tIVAR"表示实例变量。其余的我无法弄清楚。我不知道这在我放入控制台的行的上下文中意味着什么。

任何人都可以看到我做错了吗?

1 个答案:

答案 0 :(得分:0)

而不是:

UserOrganisationMapperService.call(User.where(email: ‘hello@trcr.com’).first)

尝试:

UserOrganisationMapperService.call(User.where(email: 'hello@trcr.com').first)

我怀疑被视为特殊字符(而不是')。