Ruby on Rails error: “Undefined method `call' for ”result == false“:String” error in create method

一世执手 提交于 2019-12-04 11:44:27

Looking at the stack trace and the code you have provided, the problem seems to be the invocation of has_attached_file in the Artist class.

I would suspect that the problem is caused by incompatibilities between version 3.5.4 of the paperclip gem and Rails 4.2. I would suggest you upgrade the paperclip gem.

In the list of changes for that gem, I see listed for version 4.1.1:

Bug Fix: Callback chain terminator is different in Rails 4.1, remove warnings

That could well be the culprit.

If you're running Rails 4.0+ make sure to change the 'paperclip' gem file to '~> 4.2' as suggested. It would be: 'paperclip', '~>4.2'

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!