-
Notifications
You must be signed in to change notification settings - Fork 60
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
Windows / Rails #328
Comments
Did you see #326 ? It might be a safer way to get libvips running inside Rails on Windows. |
Hi @jcupitt, Thanks again for your assistance. I am confident I am past #326 as I can successfully create the variant. I'm also questioning if I successfully turned off ActiveStorage::AnalyzeJob. I'm going to take a deeper look in there. Perhaps this issue is in the wrong repository? I've searched rails issues and not finding anything that helps me. I'm gonna keep digging. |
I was thinking that using the msys inside ruby to get ruby-vips installed might fix the rails issue, and you wouldn't need to mess with env vars. Changing PATH is especially tricky since it can trigger horrendous DLL conflicts. So I'd suggest wiping libvips and ruby-vips from your system and not setting any env vars, then just adding ruby-vips to your rails gemfile. It should pull in everything for you (check the verbose output carefully). |
I don't know why ... but Rails.application.config.active_storage.track_variants = false fixes the issue. I forked rails and tried to debug with no avail. Down my rabbit hole I tried setting track_variants to false and it worked. I reverted back to Rails 7.0.1 and it works there too. I have no idea where the root issue is. I'm unsure if it is with Rails or Vips, but leaning towards Rails ... so closing the issue here. |
Huh weird. Well, I'm glad it's working. |
FYI ... setting track variants to false fixed this: Back in Rails 7.0.1 I was unable to run the below code ... but can on my forked Rails (7.1.0.alpha).
I'm unsure why and need to move on. I'll circle back to switching from MiniMagick to vips on the next Rails release. |
Last comment :) I switched back to MiniMagick and came across an issue! I think the root problem is when a tempfile is deleted. I received the error message: Switching Ruby from 3.1.0 to Ruby 3.0.3 seems to fix everything ... so I am switching to vips :) The issue should stay closed - it has nothing to do with vips. Vips could have better error messaging. Instead of throwing an exception it just crashes. |
That's odd, I wonder why it crashed? libvips is supposed to catch errors like "unable to delete file" and return an error code. It's certainly a bug if it doesn't. I added ruby 3.1 to testing 3206143 The ruby-vips tests seem to work under ruby 3.1 for linux hosts at least. |
It sound like the crash you were seeing might be resolved with libvips/libvips#2571 (an |
Oh good point Kleis, I'd forgotten about that fix. I agree, 8.12.2 could fix it, binaries here: |
manully download lastest version and replace them solve my issue |
Hi,
My issue is that I cannot use vips as the active storage variant processor in development with my rails app. To note: (A) I can use mini magick in development, and (B) I can use vips in test (on Heroku).
Dev environment is Windows v11, RubyMine v2021.3.1, Ruby v3.1, Rails v7.0.1, libvips v8.12.1 ... then within Windows Env, I set PATH and RUBY_DLL_PATH to the libvips bin folder (C:\vips-dev-8.12\bin)
I can run a standalone ruby file that uses vips, but I cannot use vips within Rails.
When creating a variant the app crashes and I get: Process finished with exit code -1073741819 (0xC0000005). 0xC0000005 is an error code for an Access Violation exception.
Ex code that crashes: obj.image.variant(resize_to_fit: [20, 20]).processed.url
What is interesting is that the variant image is created. The second time the line of code is executed and will return the processed url.
I first was blaming ActiveStorage::AnalyzeJob, but turned it off with a monkeypatch found here: https://stackoverflow.com/questions/56445881/rails-how-to-disable-activestorage-analyzers-and-previewers.
In comparing the debug messages between mini magick and vips ... the only messages missing are:
I cannot see how this SQL update crashes the rails app. What am I missing here?
Thank you for any help,
Charlie
The text was updated successfully, but these errors were encountered: