加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – NoMethodError:未定义的方法`has_attached_fi

发布时间:2020-12-17 04:23:26 所属栏目:百科 来源:网络整理
导读:在检查插件的rails3分支后,Paperclip会产生此错误. 我的Gemfile有以下行: gem 'paperclip',:git = 'http://github.com/thoughtbot/paperclip.git',:branch = 'rails3' 并且错误消息是: NoMethodError: undefined method `has_attached_file' for #Class:0x
在检查插件的rails3分支后,Paperclip会产生此错误.
我的Gemfile有以下行:
gem 'paperclip',:git => 'http://github.com/thoughtbot/paperclip.git',:branch => 'rails3'

并且错误消息是:

NoMethodError: undefined method `has_attached_file' for #<Class:0x2a50530>

解决方法

更新06-21-10: thoughtbot版本已修复.

我必须在Application<类的结尾处将Paperclip :: Railtie.insert添加到我的application.rb中. Rails ::应用程序使其正常工作.自官方回购工作以来,我已经删除了我的前叉.希望能帮助别人. 您还需要将以下内容添加到Gemfile中

gem "paperclip",:git => "http://github.com/thoughtbot/paperclip.git"

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读