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

Incompatible Encoding Error with Listen-3.8.0 & Jekyll #569

Open
jskyzero opened this issue Jan 20, 2023 · 1 comment
Open

Incompatible Encoding Error with Listen-3.8.0 & Jekyll #569

jskyzero opened this issue Jan 20, 2023 · 1 comment

Comments

@jskyzero
Copy link

bundle exec jekyll serve
Configuration file: /Users/jskyzero/workspace/blog/design.jskyzero.com/_config.yml
            Source: /Users/jskyzero/workspace/blog/design.jskyzero.com
       Destination: /Users/jskyzero/workspace/blog/design.jskyzero.com/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
FINISH: post-data-revision
       Jekyll Feed: Generating feed for posts
                    done in 3.502 seconds.
 Auto-regeneration: enabled for '/Users/jskyzero/workspace/blog/design.jskyzero.com'
    Server address: http://127.0.0.1:4000/
  Server running... press ctrl-c to stop.
  • Change the file whose folder contains utf-8 string
E, [2023-01-20T16:54:33.307871 #11469] ERROR -- : Exception rescued in listen-worker_thread:
Encoding::CompatibilityError: incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string)
/opt/homebrew/lib/ruby/gems/3.2.0/gems/listen-3.8.0/lib/listen/silencer.rb:86:in `block in _ignore?'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/listen-3.8.0/lib/listen/silencer.rb:86:in `any?'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/listen-3.8.0/lib/listen/silencer.rb:86:in `_ignore?'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/listen-3.8.0/lib/listen/silencer.rb:80:in `silenced?'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/listen-3.8.0/lib/listen/change.rb:17:in `silenced?'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/listen-3.8.0/lib/listen/change.rb:42:in `invalidate'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/listen-3.8.0/lib/listen/adapter/base.rb:108:in `_queue_change'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/listen-3.8.0/lib/listen/adapter/darwin.rb:68:in `_process_event'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/listen-3.8.0/lib/listen/adapter/base.rb:44:in `block (2 levels) in configure'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/listen-3.8.0/lib/listen/adapter/darwin.rb:58:in `block (2 levels) in _process_changes'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/listen-3.8.0/lib/listen/adapter/darwin.rb:56:in `each'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/listen-3.8.0/lib/listen/adapter/darwin.rb:56:in `block in _process_changes'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/listen-3.8.0/lib/listen/adapter/darwin.rb:53:in `each'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/listen-3.8.0/lib/listen/adapter/darwin.rb:53:in `_process_changes'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/rb-fsevent-0.11.2/lib/rb-fsevent/fsevent.rb:77:in `run'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/listen-3.8.0/lib/listen/adapter/darwin.rb:49:in `block in _run'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/listen-3.8.0/lib/listen/thread.rb:26:in `rescue_and_log'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/listen-3.8.0/lib/listen/thread.rb:18:in `block in new'
--- Thread.new ---
/opt/homebrew/lib/ruby/gems/3.2.0/gems/listen-3.8.0/lib/listen/adapter/darwin.rb:49:in `_run'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/listen-3.8.0/lib/listen/adapter/base.rb:79:in `block in start'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/listen-3.8.0/lib/listen/thread.rb:26:in `rescue_and_log'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/listen-3.8.0/lib/listen/thread.rb:18:in `block in new'
  • Other information (It seems like only crash with macOS)
~ sw_vers
ProductName:		macOS
ProductVersion:		13.0
BuildVersion:		22A380

➜  ~ ruby --version
ruby 3.2.0 (2022-12-25 revision a528908271) [arm64-darwin22]

# project tree structure
# find the project at https://github.com/jskyzero/design.jskyzero.com
➜  _posts git:(jekyll) tree -L 2
.
├── 日常
│   ├── chapter0
│   └── chapter1
├── 杂谈
│   ├── 2019-05-18-penguin_and_rpg.md  # for example, change this file, then crash
....
  • I change local file to fix this error, but I‘m not the expert at ruby, so i made this issue
# Encoding::CompatibilityError: incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string)

# /opt/homebrew/lib/ruby/gems/3.2.0/gems/listen-3.8.0/lib/listen/adapter/darwin.rb:68:in `_process_event'

# before
rel_path = path.relative_path_from(dir).to_s 
# after
rel_path = path.relative_path_from(dir).to_s.force_encoding('utf-8')
@Rasinari
Copy link

Works also in ruby 3.1.3

@guard guard deleted a comment from LouisaNikita Feb 28, 2024
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