plasma-manager icon indicating copy to clipboard operation
plasma-manager copied to clipboard

rc2nix.rb:117:in `===': invalid byte sequence in US-ASCII (ArgumentError)

Open ca5ua1 opened this issue 2 years ago • 2 comments

Fail on non NixOS:


LC_ALL=en_US.UTF-8 nix --extra-experimental-features nix-command --extra-experimental-features flakes  run github:pjones/plasma-manager

/nix/store/40iwnlr30ykqm5ynm0bbk6bsjjc750ad-bash-5.1-p16/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
Traceback (most recent call last):
        9: from /nix/store/hljv83bhp04fsavh0mvcksn65w0rpsh6-rc2nix.rb:266:in `<main>'
        8: from /nix/store/hljv83bhp04fsavh0mvcksn65w0rpsh6-rc2nix.rb:176:in `run'
        7: from /nix/store/hljv83bhp04fsavh0mvcksn65w0rpsh6-rc2nix.rb:176:in `each'
        6: from /nix/store/hljv83bhp04fsavh0mvcksn65w0rpsh6-rc2nix.rb:180:in `block in run'
        5: from /nix/store/hljv83bhp04fsavh0mvcksn65w0rpsh6-rc2nix.rb:114:in `parse'
        4: from /nix/store/hljv83bhp04fsavh0mvcksn65w0rpsh6-rc2nix.rb:114:in `open'
        3: from /nix/store/hljv83bhp04fsavh0mvcksn65w0rpsh6-rc2nix.rb:115:in `block in parse'
        2: from /nix/store/hljv83bhp04fsavh0mvcksn65w0rpsh6-rc2nix.rb:115:in `each'
        1: from /nix/store/hljv83bhp04fsavh0mvcksn65w0rpsh6-rc2nix.rb:117:in `block (2 levels) in parse'
/nix/store/hljv83bhp04fsavh0mvcksn65w0rpsh6-rc2nix.rb:117:in `===': invalid byte sequence in US-ASCII (ArgumentError)

ca5ua1 avatar Apr 02 '23 20:04 ca5ua1

I have no idea why US-ASCII is being used on line 117.

I'm happy to merge a fix once someone figures this out.

pjones avatar Apr 10 '23 18:04 pjones

Got it working by setting the following env variable:

export RUBYOPT="-KU -E utf-8:utf-8"

Source

I also set $LANGUAGE and $LC_ALL to $LANG (de_DE.UTF-8 for me) as these were not set, not sure if that was required.

TECHNOFAB11 avatar May 02 '23 15:05 TECHNOFAB11