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

translation missing: en.errors.messages.mini_magick_processing_error #1486

Closed
marcusramberg opened this issue Oct 26, 2014 · 35 comments
Closed

translation missing: en.errors.messages.mini_magick_processing_error #1486

marcusramberg opened this issue Oct 26, 2014 · 35 comments

Comments

@marcusramberg
Copy link

@marcusramberg marcusramberg commented Oct 26, 2014

I've got some minimagick issue, but I can't get to the actual error because of a localization error? Shouldn't the module just fall back to the default locale (English?) if there isn't any translation for the set locale?

Exception CarrierWave::ProcessingError -> translation missing: en.errors.messages.mini_magick_processing_error
   /Users/marcus/.rvm/gems/ruby-2.1.2/gems/carrierwave-0.8.0/lib/carrierwave/processing/mini_magick.rb:264:in `rescue in manipulate!'
   /Users/marcus/.rvm/gems/ruby-2.1.2/gems/carrierwave-0.8.0/lib/carrierwave/processing/mini_magick.rb:258:in `manipulate!'
@bensie
Copy link
Member

@bensie bensie commented Nov 19, 2014

Please update your gem and try again. There is an English translation for mini_magick_processing_error:

mini_magick_processing_error: "Failed to manipulate with MiniMagick, maybe it is not an image? Original Error: %{e}"

@bensie bensie closed this Nov 19, 2014
@coneybeare
Copy link

@coneybeare coneybeare commented Dec 9, 2016

I'm seeing this again on 1.0.0.rc. Have any of the translation paths changed?

@salmanx
Copy link

@salmanx salmanx commented Jan 17, 2017

I have also got the same error. But installing imagemagick helped me to get rid of this. offical doc also suggest to install imagemagick before install minimagic and carrierwave.

@Advice-Dog
Copy link

@Advice-Dog Advice-Dog commented Jan 21, 2017

I'm getting the same error when trying to include MiniMagick and use the default thumbnail block.

If I comment it back out, it works fine.

include CarrierWave::MiniMagick
...
version :thumb do
    process resize_to_fit: [64, 64]
end
@salmanx
Copy link

@salmanx salmanx commented Jan 21, 2017

@Advice-Dog
Copy link

@Advice-Dog Advice-Dog commented Jan 21, 2017

I have ImageMagick installed, and it doesn't fail on bundle install, it's only failing when attempting to actually calling resize_to_fit. But the error says it's missing a translation, even though I can see the translation within the .yml file.

@salmanx
Copy link

@salmanx salmanx commented Jan 21, 2017

@Advice-Dog
Copy link

@Advice-Dog Advice-Dog commented Jan 21, 2017

resize_to_fill also doesn't work. Same error about missing the translation.

@salmanx
Copy link

@salmanx salmanx commented Jan 21, 2017

using windows? I am not sure why it's not working but it's working fine in my ubuntu. You should ask someone experienced here or stack overflow.

@Advice-Dog
Copy link

@Advice-Dog Advice-Dog commented Jan 21, 2017

Yes, I'm running Windows 10. I don't know either, but just thought I'd add in more steps on reproducing the issue.

@gichuru
Copy link

@gichuru gichuru commented Jan 24, 2017

This was a real pain for a couple of days. I managed to solve it by reinstalling the carrierwave gem again

  1. Go to your gemfile, delete gem 'carrierwave'
  2. Run bundle install
  3. Go back to gem file and add gem 'carrierwave'
  4. Run bundle install
  5. Run rails s
  6. Add a new image.

Best of luck!

@Advice-Dog
Copy link

@Advice-Dog Advice-Dog commented Jan 29, 2017

@gichuru
I tried this a few times but still no luck. Even went into Ruby and deleted the gem to force it to fetch a new version, but still seeing the same error.

@robert-paul
Copy link

@robert-paul robert-paul commented Feb 1, 2017

@Advice-Dog @marcusramberg

Get this. You have to install imagemagick to your local machine. I don't know why, but when using the carrierwave or mini_magick gem with Rails locally (and not an IDE) it is needed.

You can use bower or whatever you're usually using. I have a macbook so here's the solution for that.

For mac: If you haven't used homebrew before, follow instructions here to install http://brew.sh/
Then on your computer go to utilities, then open Terminal. Enter "brew install imagemagick" (exclude quotation marks).

Hope this helps. Wasted 3 hours today on this. Thought it was a problem with S3.

@Advice-Dog
Copy link

@Advice-Dog Advice-Dog commented Feb 1, 2017

@dinosaurforest @marcusramberg

I actually already had ImageMagick installed, but decided to try again. I'm using Windows, so I grabbed the "ImageMagick-7.0.4-6-Q16-x64-dll.exe" off of https://www.imagemagick.org/script/binary-releases.php.

Ran the installer, checked every box for optional stuff ( who knows, may help ), and during the install it did pop up with a lot of "This file already exists, overwrite?" Which I accepted all of them.

... and it seems to have worked? I'm not sure what's changed, but it seems to upload without error, and checking there is a thumbnail generated.

Thanks.

@celsoMartins
Copy link

@celsoMartins celsoMartins commented Feb 18, 2017

complementing @dinosaurforest excellent answer, reinstall will do the work too..

@robert-paul
Copy link

@robert-paul robert-paul commented Feb 19, 2017

@celsoMartins Was debating whether to propose adding this to the documentation. I think anyone using the carrierwave and mini_magick gem in the development environment on their local machine would need to install imagemagick to their local computer, because the gem relies on a specific C dependency. Would be useful to know. What are your thoughts? Too much?

@jrothrock
Copy link

@jrothrock jrothrock commented Mar 1, 2017

I'm currently having this issue in production. I'm using Ubuntu and have purged and reinstalled imagemagick a few times. Mini magic is 4.6.0. I've brought this up over at minimagic, but I'm not sure if this is minimagic or carrierwave: minimagick/minimagick#402. Here are the errors I'm getting:

MiniMagick::Invalid (`identify /tmp/mini_magick20170301-15568-abuqr9.mov` failed with error:
identify: delegate failed `"ffmpeg" -v -1 -i "%i" -vframes %S -vcodec pam -an -f rawvideo -y "%u.pam" 2> "%Z"' @ error/delegate.c/InvokeDelegate/1310.
identify: unable to open image `/tmp/magick-15578WTub7KbBHjoR.pam': No such file or directory @ error/blob.c/OpenBlob/2712.

Edit: turns out I didn't have ffmpeg installed

@r-trigo
Copy link

@r-trigo r-trigo commented Mar 2, 2017

Give up on Windows ruby server. Too much problems. I switched to Ubuntu-like operative system and ran:
apt-get install imagemagick

That's all it took to work.

btw: using minimagick gem

@aswan-zz
Copy link

@aswan-zz aswan-zz commented Mar 5, 2017

Question about this - does installing imagemagick just fix the underlying error or does it somehow also fix the problem with missing translations? I assume it's the first, in which case what is the fix for the missing error translations in minimagick?

@r-trigo
Copy link

@r-trigo r-trigo commented Mar 5, 2017

@aswan-zz what is the underlying problem?

@aswan-zz
Copy link

@aswan-zz aswan-zz commented Mar 5, 2017

@ruimigueltrigo -- Well the underlying problem appears to be that a processing error is thrown if imagemagick isn't installed or accessible on the host. A second problem seems to be that mini-magick throws an error "translation missing: en.errors.messages.mini_magick_processing_error", which makes finding the source of the underlying error more difficult.

I could be wrong about this though because I'm still trying to figure it out. I have imagemagick installed and it seems to be working, but I still get the "translation missing: en.errors.messages.mini_magick_processing_error" message and the upload/processing of the image fails. I'm currently going through the source code of mini_magick trying to figure out where the error is getting thrown.

@r-trigo
Copy link

@r-trigo r-trigo commented Mar 5, 2017

Are you using minimagick or imagemagick gem?

@jrothrock
Copy link

@jrothrock jrothrock commented Mar 5, 2017

@aswan-zz I was also having that issue. Carrierwave swallows the error from minimagic. Read this issue over at minimagic to see how to enable error logging. You may just need to download ffmpeg.

@jrothrock
Copy link

@jrothrock jrothrock commented Apr 19, 2017

I ran into this issue again, and realized that I had a minimagic process running in an uploader it shouldn't have been in

@nunommc
Copy link

@nunommc nunommc commented Apr 28, 2017

I see this issue in current version 1.0.0. I realized that in the code the I18n.load_path is being added only on the spec_helper.rb .. shouldn't it be loaded by carrierwave.rb instead?

@mcansky
Copy link

@mcansky mcansky commented Sep 8, 2017

any update / fix on this issue ?

@mcansky
Copy link

@mcansky mcansky commented Sep 8, 2017

after trying different things ... I managed to get to the bottom of the affair. Here follows the gist of it.

As the translations were missing (or unaccessible to CW) I followed a hint from another issue : #1729 and pasted the bunch of translations (french but you could do the same with a bunch of english ones too if your locale is :en, etc). To add those, go paste (or type something in) them nicely in your config/locales/[lang].yml . The main point here is to give carrierwave and rails something to print out rather than raise an exception on the missing translation for another exception.

As I wanted to get as close to MiniMagick as possible I directly worked with the uploader :

[3] pry(main)> pic_up = PictureUploader.new
=> #<PictureUploader:0x007fc090032818 @model=nil, @mounted_as=nil>
[4] pry(main)> pic_up.cache!(File.open("#{Rails.root}/public/images/products/#{_name}_170.png"))
D, [2017-09-08T16:10:24.987245 #6255] DEBUG -- : [0.02s] identify /var/folders/by/r_tpf47x3qs3jqx2tcc_7g5h0000gn/T/mini_magick20170908-6255-ltym2n.png
CarrierWave::ProcessingError: La manipulation d'image avec MiniMagick a échoué. Peut-être que ce n'est pas une image ? Erreur originale: `identify /var/folders/by/r_tpf47x3qs3jqx2tcc_7g5h0000gn/T/mini_magick20170908-6255-ltym2
n.png` failed with error:
identify: unable to load module '/usr/local/Cellar/imagemagick/7.0.5-6/lib/ImageMagick//modules-Q16HDRI/coders/png.la': file not found @ error/module.c/OpenModule/1266.
identify: no decode delegate for this image format `PNG' @ error/constitute.c/ReadImage/509.
from /Users/ange/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/carrierwave-1.1.0/lib/carrierwave/processing/mini_magick.rb:307:in `rescue in manipulate!'
[11] pry(main)>

The direct error message for CW is in french but what interest us is in english as part of the original (read 'mini magick') :

identify /var/folders/by/r_tpf47x3qs3jqx2tcc_7g5h0000gn/T/mini_magick20170908-6255-ltym2
n.png` failed with error:
identify: unable to load module '/usr/local/Cellar/imagemagick/7.0.5-6/lib/ImageMagick//modules-Q16HDRI/coders/png.la': file not found @ error/module.c/OpenModule/1266.
identify: no decode delegate for this image format `PNG' @ error/constitute.c/ReadImage/509.
from /Users/ange/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/carrierwave-1.1.0/lib/carrierwave/processing/mini_magick.rb:307:in `rescue in manipulate!'

"Gasp"

That directed me to Homebrew/legacy-homebrew#14325 which basically points to a badly linked up libpng.

To fix this you just need to play with your package manager (example using homebrew) :

# brew uninstall imagemagick; brew install imagemagick; brew install libpng; brew unlink libpng ; brew link libpng

That fixed it for me. 🚀

@tomprats
Copy link
Contributor

@tomprats tomprats commented Sep 10, 2017

What fixed my problem was updating Xcode. I have no idea what it actually updated, but I guess it would be a dependency of MiniMagick. That's the underlying problem, but the translation part probably still exists

@pughpugh
Copy link

@pughpugh pughpugh commented Sep 11, 2017

In regards to the translations, the readme does seem to suggest you need to manually add some translations to your locale file. The documentation perhaps has got out of sync with the actual locales needed. As @mcansky indicated, the error is much more obvious at that point.

@bater
Copy link

@bater bater commented Nov 7, 2017

After I run brew upgrade imagemagick and update to imagemagick 7.0.7-10, everything works fine.

Thanks everyone.

@goxr3plus
Copy link

@goxr3plus goxr3plus commented Jan 4, 2018

@gichuru

  1. I installed ImageMagick on Windows 10.
  2. Opened a new command line after the installation
  3. Followed your steps
  4. Magic happened!

magic

@sitthichai
Copy link

@sitthichai sitthichai commented Oct 20, 2018

This was a real pain for a couple of days. I managed to solve it by reinstalling the carrierwave gem again

  1. Go to your gemfile, delete gem 'carrierwave'
  2. Run bundle install
  3. Go back to gem file and add gem 'carrierwave'
  4. Run bundle install
  5. Run rails s
  6. Add a new image.

Best of luck!

It's work, Thank you

@hgky95
Copy link

@hgky95 hgky95 commented Nov 26, 2018

I faced with this issue (on Windows 10).
My solution is that you need to:

  1. Make sure you already install ImageMagick before you use Mini_magick
  2. Restart your machine.
    Then it's worked.
@goxr3plus
Copy link

@goxr3plus goxr3plus commented Nov 26, 2018

@vnbrs
Copy link

@vnbrs vnbrs commented Dec 28, 2018

For me, on macOS, I forgot to install imagemagick 😜

brew install imagemagick

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.