Solvedatom beautify Beautify error on macOS Sierra: Can't locate YAML/Tiny.pm

Description

Beautify fails to run on my macOS Sierra machine.

Code used & Steps to Reproduce

I stored the following as test.tex and ran Atom Beautify: Beautify Editor

\begin{center}
\begin{Large}
\bf Big Text
\end{Large}
\end{center}

The error I receive is the following

Can't locate YAML/Tiny.pm in @INC (you may need to install the YAML::Tiny module) (@INC contains: /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.2 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at /Library/TeX/texbin/latexindent line 39. BEGIN failed--compilation aborted at /Library/TeX/texbin/latexindent line 39.

Debug

Here is a link to the debug.md Gist: https://gist.github.com/birnstiel/3791b54c1acb0884d40becf2e26a51c7

Checklist

I have checked all the boxes in the checklist.

17 Answers

✔️Accepted Answer

I got it working, but it might be longer than you are interested in.

sudo cpan Unicode::GCString
sudo cpan App::cpanminus
sudo cpan YAML::Tiny
sudo perl -MCPAN -e 'install "File::HomeDir"'

You may not need all of them. I got this (the last three lines with my edit of the cpanm typo) from https://github.com/ketan/BeautifyLatex

I'd suggest looking at those.

Now, to get those lines to work, my gzip was broken and I had to install it. I did so with my MacPorts installation

I will try to answer questions, but I have no idea why these work. I was just following instructions, then noting the error that stated that I might need to install Unicode::GCString when perl latexindent executed in the directory where latexindent is located failed.

Other Answers:

Hey, somehow I got it fixed too now, but I have not much clue as how I did it.

In total I ran:

sudo cpan Unicode::GCString
sudo cpan App::cpanminus
sudo cpan YAML::Tiny
sudo perl -MCPAN -e 'install "File::HomeDir"'
sudo /usr/bin/cpan5.18 Unicode::GCString
sudo /usr/bin/cpan5.18 App::cpanminus
sudo /usr/bin/cpan5.18 YAML::Tiny
sudo /usr/bin/perl5.18 -MCPAN -e 'install "File::HomeDir"'

But after that it still gave me errors.

From James-Yu/LaTeX-Workshop#376 (comment) I ran:

sudo cpan Log::Log4perl
sudo cpan Log::Dispatch

Then, from https://github.com/ketan/BeautifyLatex, I ran:

$ sudo cpan App::cpanminus
$ sudo cpan YAML::Tiny
$ sudo perl -MCPAN -e 'install "File::HomeDir"'

and now it works. I have no clue why.

Thanks @josephcslater for trying to help though :)

Found my issue. Somewhere latexindent insists on using the System Perl, which at this time it 5.18. This was evident by the error stating an issue with 5.18. I'd prefer to move on to a maintained Perl, versus Apple's, but couldn't figure it out. So, I modified my instructions above to:

sudo /usr/bin/cpan5.18 Unicode::GCString
sudo /usr/bin/cpan5.18 App::cpanminus
sudo /usr/bin/cpan5.18 YAML::Tiny
sudo /usr/bin/perl5.18 -MCPAN -e 'install "File::HomeDir"'

3 hours later, it works.

More Issues: