rich
rich copied to clipboard
Error when using carrierwave
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
:+1: +1 for this. doesn't work with carrierwave
Carrierwave support was broken with this commit: https://github.com/bastiaanterhorst/rich/commit/e3125089fcc7cdec8a6e3fb4494df0eea645f0d8#commitcomment-6785246
+1 for this, is carrierwave support coming back?
+1
+1 any updates here?
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
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 method
backend=' for Rich:Module`