rich icon indicating copy to clipboard operation
rich copied to clipboard

undefined method 'has_attached_file'

Open jakoss opened this issue 9 years ago • 6 comments

> Booting WEBrick
=> Rails 4.1.8 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
=> Ctrl-C to shutdown server
Exiting
/Volumes/D/KonsultacjeSpoleczneJastrzebieZdroj/vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.8/lib/active_record/dynamic_matchers.rb:26:in `method_missing': undefined method `has_attached_file' for #<Class:0x007fbc1689b230> (NoMethodError)
from /Volumes/D/KonsultacjeSpoleczneJastrzebieZdroj/vendor/bundle/ruby/2.2.0/bundler/gems/rich-2ee815f0d8f5/app/models/rich/rich_file.rb:13:in `<class:RichFile>'

After clean install from git gem. Any idea why is that happening?

jakoss avatar Mar 30 '15 16:03 jakoss

Ok, i see now that's problem with carrierwave. But why is model using only paperclip function?

jakoss avatar Mar 30 '15 16:03 jakoss

I don't have that time today and tomorrow, would be nice if someone could dig into this.

iduuck avatar Mar 30 '15 16:03 iduuck

Looks like duplicate paperclip related code in app/models/rich/rich_file.rb and lib/rich/backends/paperclip.rb

zuf avatar Apr 09 '15 14:04 zuf

:+1: I moved all paperclip code to paperclip.rb(https://github.com/kreativgebiet/rich/pull/183) and it works fine with paperclip and carrierwave

donbobka avatar Apr 29 '15 12:04 donbobka

This seems to have a pull request, can it be merged?

gwincr11 avatar Jul 22 '15 01:07 gwincr11

I'm having this issue as well - and I definitely have the paperclip gem installed. I'm using Rails 5 and paperclip 5, which is likely the issue.

Any suggestions?

=> Rails 5.0.0.rc2 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
Exiting
/Users/ecook/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.0.rc2/lib/active_record/dynamic_matchers.rb:21:in `method_missing': undefined method `has_attached_file' for #<Class:0x007fef9578aa00> (NoMethodError)
    from /Users/ecook/.rvm/gems/ruby-2.3.1/bundler/gems/rich-2c8f85438e73/lib/rich/backends/paperclip.rb:9:in `block in <module:Paperclip>'

etcook avatar Jun 30 '16 20:06 etcook