Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't upload any images - NoMethodError Exception: undefined method `rich_file=' #140

Open
matteofuzz opened this issue Feb 11, 2014 · 21 comments
Labels

Comments

@matteofuzz
Copy link

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
@efatsi
Copy link

efatsi commented Feb 11, 2014

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.

@mackermedia
Copy link
Contributor

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.

@neutralino1
Copy link

Any news regarding this issue? I see the same problem with the same configuration (Rails 4.0.0 and Paperclip 4.1.0).

@neutralino1
Copy link

Ok, it works after a night's sleep. Weird.

@efatsi
Copy link

efatsi commented Mar 18, 2014

@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

@mackermedia
Copy link
Contributor

@neutralino1 or you could try something similar to an open pull request
which looks like it might solve the problem for paperclip only. PR:
#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//issues/140#issuecomment-37930180
.

@neutralino1
Copy link

Yeah, that's my PR.

@mackermedia
Copy link
Contributor

Oh! Well then! At first glance, it looks like this would be needed for the CarrierWave backend as well.

@neutralino1
Copy link

Indeed, but I am not using CarrierWave and I don't have the time to set it up and test it. Sorry.

@asecondwill
Copy link

i'm getting the same error. What is the best thing to do? use neutralino1's fork or something else?

@renews renews added the Fix-me label Jun 18, 2014
@jererutter
Copy link

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.

@iduuck iduuck closed this as completed Dec 2, 2015
@Preen
Copy link
Contributor

Preen commented Dec 4, 2015

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.

@iduuck
Copy link
Contributor

iduuck commented Dec 5, 2015

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.

@Preen
Copy link
Contributor

Preen commented Dec 5, 2015

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?

@iduuck
Copy link
Contributor

iduuck commented Dec 5, 2015

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
#140 (comment).

@Preen
Copy link
Contributor

Preen commented Dec 5, 2015

Thanks!

@iduuck iduuck reopened this Dec 6, 2015
@Preen
Copy link
Contributor

Preen commented Dec 17, 2015

Can I manually require Rich in order to temporary fix this? Because it really destroys my dev :<

@iduuck
Copy link
Contributor

iduuck commented Dec 18, 2015

@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?

@Ammet
Copy link

Ammet commented Feb 12, 2016

@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'

@iduuck
Copy link
Contributor

iduuck commented Feb 26, 2016

@Ammet: Doesn't your pull request (#203) fix this issue?

@Ammet
Copy link

Ammet commented Feb 26, 2016

Yep

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

10 participants