【问题标题】:Unable to run latexindent macOS Monterey 12.0.1无法运行 latexindent macOS Monterey 12.0.1
【发布时间】:2022-01-17 08:13:20
【问题描述】:

我需要能够运行命令latexindent,但我每次都会收到此错误:

Unknown PerlIO layer 'encoding' at /usr/local/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/Document.pm line 21.
Unknown PerlIO layer "encoding" at /opt/homebrew/Cellar/perl/5.34.0/lib/perl5/5.34.0/open.pm line 126.
Unknown PerlIO layer "encoding" at /opt/homebrew/Cellar/perl/5.34.0/lib/perl5/5.34.0/open.pm line 134.
Unknown PerlIO layer "encoding" at /opt/homebrew/Cellar/perl/5.34.0/lib/perl5/5.34.0/open.pm line 135.
Attempt to reload PerlIO/encoding.pm aborted.
Compilation failed in require at /usr/local/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/FileExtension.pm line 20.
BEGIN failed--compilation aborted at /usr/local/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/FileExtension.pm line 20.
Compilation failed in require at /usr/local/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/Document.pm line 29.
BEGIN failed--compilation aborted at /usr/local/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/Document.pm line 29.
Compilation failed in require at /usr/local/texlive/2021/bin/universal-darwin/latexindent line 27.
BEGIN failed--compilation aborted at /usr/local/texlive/2021/bin/universal-darwin/latexindent line 27.

我通过这个命令brew install --cask mactex 用 Homebrew 安装了 MacTeX。当我输入命令which latexindent 时,它会给出/usr/local/texlive/2021/bin/universal-darwin/latexindent。我有 Perl v5.34.0,它在这里/opt/homebrew/bin/perl

如何设置 PerlIO 的编码?

【问题讨论】:

    标签: encoding homebrew macos-monterey tex-live perl5.34


    【解决方案1】:

    基于this question,我找到了解决我的问题的方法:

    1. 我删除了:~/perl5~/.cpan~/.cpanm
    2. 我重新启动了计算机;
    3. 然后我使用命令cpan install Log::Log4perl 安装了Log::Log4perl。那里问我是否要选择自动或 手动配置模式。我选择了自动模式;
    4. 然后我根据this post安装了其他模块: SQL::Statement,Text::CSV_XS,DBD::CSV,Log::Dispatch::File,cpan install YAML::Tiny,File::HomeDir,Unicode::GCString,Mac::SystemDirectory;

    最后,latexindent --version 命令给了我3.9.1, 2021-03-21 的版本,它可以工作。

    【讨论】:

    • 不再需要 Log4perl :)
    猜你喜欢
    • 1970-01-01
    • 2021-12-15
    • 2022-07-22
    • 2021-12-12
    • 2023-02-08
    • 2021-12-12
    • 1970-01-01
    • 2021-12-18
    • 2022-08-16
    相关资源
    最近更新 更多