rich
rich copied to clipboard
I can't upload any images - NoMethodError Exception: undefined method `rich_file='
Using Rails 4.0.0 and Paperclip 4.1.0 When I select a new image to upload app raise: " - NoMethodError Exception: undefined method `rich_file=' " In debugger I verified that the exception raises at line 62
60. if(file_params)
61. file_params.content_type = Mime::Type.lookup_by_extension(file_params.original_filename.split('.').last.to_sym)
62. @file.rich_file = file_params
63. end
I've seen this issue as well, but using CarrierWave. My guess is it has something to do with the order in which files are being loaded, and the backend (either paperclip or carrierwave) is not getting included.
It almost seemed like an autoload issue as it would work, and then stop after awhile. Wondering if the backend isn't getting re-loaded properly after Rails autoloads files.
Any news regarding this issue? I see the same problem with the same configuration (Rails 4.0.0 and Paperclip 4.1.0).
Ok, it works after a night's sleep. Weird.
@neutralino1 I bet that it's going to happen to you again. Unfortunately I didn't have time for a proper fix, but if you hit the issue again, a working hack is to fork the repo, and manually include your backend of choice - https://github.com/vigetlabs/rich/commit/8d6707ccf7f11b7b197deebdca62eaa9cd3add53
@neutralino1 or you could try something similar to an open pull request which looks like it might solve the problem for paperclip only. PR: https://github.com/bastiaanterhorst/rich/pull/145
On Tuesday, March 18, 2014, Eli Fatsi [email protected] wrote:
@neutralino1 https://github.com/neutralino1 I bet that it's going to happen to you again. Unfortunately I didn't have time for a proper fix, but if you hit the issue again, a working hack is to fork the repo, and manually include your backend of choice - vigetlabs@8d6707chttps://github.com/vigetlabs/rich/commit/8d6707ccf7f11b7b197deebdca62eaa9cd3add53
Reply to this email directly or view it on GitHubhttps://github.com/bastiaanterhorst/rich/issues/140#issuecomment-37930180 .
Yeah, that's my PR.
Oh! Well then! At first glance, it looks like this would be needed for the CarrierWave backend as well.
Indeed, but I am not using CarrierWave and I don't have the time to set it up and test it. Sorry.
i'm getting the same error. What is the best thing to do? use neutralino1's fork or something else?
Chances are you just needed to restart your rails server. Often times newly-installed gems won't work properly until you give everything a reboot.
Why close this issue when its not fixed? It can't be that I have to restart the server if I make one change to a locale file or anything in the view when developing? This is a real issue that is affecting the workflow.
It's just that you need to restart the rails server once.
If you change a locale file it's not an issue for rich
, but for rails
.
How can it not be? If I make a change on the locale file and I get a NoMethodError Exception: undefined method `rich_file=' error it sure is related to rich?
Ok, my apologize. Wasn't up to date about the issue anymore.
Will open again. On Sat 5 Dec 2015 at 22:20 Philip Mannheimer [email protected] wrote:
How can it not be? If I make a change on the locale file and I get a NoMethodError Exception: undefined method `rich_file=' error it sure is related to rich?
— Reply to this email directly or view it on GitHub https://github.com/kreativgebiet/rich/issues/140#issuecomment-162248732.
Thanks!
Can I manually require Rich in order to temporary fix this? Because it really destroys my dev :<
@preen I stumbled upon this in my local dev setup, when I tested, but it just worked for me after a restart (for the whole time)..
Which version are you on?
@iDuuck I have this issue too. Using ActiveAdmin. Change ActiveAdmin file symbol and the error appears.
NoMethodError in Rich::Files#index
undefined method `rich_file' for #<Rich::RichFile:0x007fc24add2048>
Gemfile.lock
GIT
remote: https://github.com/kreativgebiet/rich.git
revision: 8b7a80101b18a3fdd34fc5e4275b0d9d421a58a9
specs:
rich (1.4.8)
jquery-rails
kaminari
mime-types
rack-raw-upload
rails (>= 3.2.0)
sass-rails
Gemfile
gem 'rich', git: 'https://github.com/kreativgebiet/rich.git'
@ammet: Doesn't your pull request (https://github.com/kreativgebiet/rich/pull/203) fix this issue?
Yep