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

Ruby 3.2.0 / Rails 7.0.4 invalid byte sequence in UTF-8 (ArgumentError) #205

Closed
jasonfine opened this issue Jan 5, 2023 · 4 comments
Closed

Comments

@jasonfine
Copy link

irb(main):001:0> image_optim = ::ImageOptim.new
/usr/local/bundle/gems/image_optim-0.31.2/lib/image_optim/bin_resolver/bin.rb:124:in `[]': invalid byte sequence in UTF-8 (ArgumentError)

          date_str = capture("#{escaped_path} 2>&1")[date_regexp]
                                                     ^^^^^^^^^^^
irb(main):002:0> 
@toy
Copy link
Owner

toy commented Jan 6, 2023

From the error looks like running pngout 2>&1 in your environment gives a string that can't be converted to UTF-8.
What does running `pngout 2>&1` output and what is the encoding of the string?
And environment questions:
Is it dependant on ruby version and presence of rails?
Is it plain irb, rails console or something else?
Something special about the environment?

@jasonfine
Copy link
Author

What does running pngout 2>&1 output and what is the encoding of the string?

Sorry - where should i run this command?

And environment questions:
Is it dependant on ruby version and presence of rails?

This started happening after upgrading Ruby 3.1 to 3.2, and yes this is in the context of a Rails 7.0.4 app.

Is it plain irb, rails console or something else?

Rails console

Something special about the environment?

Using Docker

@toy
Copy link
Owner

toy commented Jan 7, 2023

Sorry - where should i run this command?

In the same console, as ImageOptim.new

Using Docker

Would you be able to create minimal reproducible example then?

@jasonfine
Copy link
Author

Upon closer inspection, i think this is due to missing binaries.

Thanks for your time

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

No branches or pull requests

2 participants