rich icon indicating copy to clipboard operation
rich copied to clipboard

Error when using carrierwave

Open tagliala opened this issue 10 years ago • 7 comments

gemfile:

gem 'devise'
gem 'rails_admin'
gem 'kaminari'
gem 'carrierwave', '0.10.0'
gem 'mini_magick'
gem 'rich', github: 'bastiaanterhorst/rich'
#gem 'paperclip'

initializer:

require "rich"

if Object.const_defined?("Rich")
  Rich.setup do |config|
    # == Backend configuration
    # Rich uses Paperclip (https://github.com/thoughtbot/paperclip) by default.
    # You will need to add it to your Gemfile, however.
    # config.backend = :paperclip
    #
    # Optionally, you can use CarrierWave (https://github.com/carrierwaveuploader/carrierwave).
    # You will need to add it to your Gemfile.
    config.backend = :carrierwave
# ...
$ rails s
~/.rvm/gems/ruby-2.1.4/gems/activerecord-4.1.8/lib/active_record/dynamic_matchers.rb:26:in `method_missing': undefined method `has_attached_file' for #<Class:0x007fe8afa39950> (NoMethodError)

I need to include also paperclip in order to make rich work.

I suspect that something here is missing: https://github.com/bastiaanterhorst/rich/blob/a2d866f56277405cb91b648ec3091bda725999df/app/models/rich/rich_file.rb#L13

tagliala avatar Nov 30 '14 20:11 tagliala

:+1: +1 for this. doesn't work with carrierwave

AndreiRailean avatar Dec 02 '14 02:12 AndreiRailean

Carrierwave support was broken with this commit: https://github.com/bastiaanterhorst/rich/commit/e3125089fcc7cdec8a6e3fb4494df0eea645f0d8#commitcomment-6785246

benhutton avatar Feb 17 '15 01:02 benhutton

+1 for this, is carrierwave support coming back?

arun057 avatar Apr 27 '15 21:04 arun057

+1

twnaing avatar Oct 26 '15 16:10 twnaing

+1 any updates here?

arun057 avatar Jan 03 '16 22:01 arun057

I haven't run the code myself, but it looks like this should be fixed in master with https://github.com/kreativgebiet/rich/pull/183

benhutton avatar Jan 04 '16 02:01 benhutton

This is the error I got when I tried to set it as the backend. Havent looked in code yet. Maybe documentation is out of date? NoMethodError: undefined methodbackend=' for Rich:Module`

arun057 avatar Jan 04 '16 02:01 arun057