Beautify fails to run on my macOS Sierra machine.
I stored the following as test.tex and ran Atom Beautify: Beautify Editor
~latex
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.
~
Here is a link to the debug.md Gist: https://gist.github.com/birnstiel/3791b54c1acb0884d40becf2e26a51c7
I have checked all the boxes in the checklist.
I have the same error on macOS Sierra. Has anyone come up with a solution?
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.
Yesss, this worked for me. I used all 4, I needed at least the Unicode::GCString and the YAML::Tiny, not sure if the others were necessary.
On Sep 4, 2017, at 9:56 PM, Joseph C. Slater notifications@github.com wrote:
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 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.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub https://github.com/Glavin001/atom-beautify/issues/1792#issuecomment-327071117, or mute the thread https://github.com/notifications/unsubscribe-auth/ABtkWVnBUgXPFn4R35Qq7mdzSo2tSGLiks5sfNRzgaJpZM4OoOx7.
You have no idea how lucky you were that this unknowledgeable hacker lucked upon a solution! I just got lucky somehow. Glad you have it now.
This issue has been automatically marked as stale because it has not had recent activity. If this is still an issue, please add a comment. It will be closed if no further activity occurs. Thank you for your contributions.
Well, this no longer seems to solve the problem for me. I'm now getting the error of the original post after a new install.
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.
Interesting, mine broke with a recent system update but I was able to get it working again by rerunning the original commands.
I think this is tied to my use of MacPorts, although it was indeed installed before. Further, Beautify might have been using the other perl before. I couldn't figure out how to set this, so I decided I have to "fix" the system Perl.
@josephcslater Thank you so much. I solved my problem following your advice.
Sadly, I am getting the same error, even after executing the cpan commands above.
[13:15:06] Formatting failed with exit code 2
[13:15:06] stderr: Can't locate YAML/Tiny.pm in @INC (you may need to install the YAML::Tiny module) (@INC contains: /usr/local/texlive/2017/texmf-dist/scripts/latexindent /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/darwin-thread-multi-2level /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 /usr/local/texlive/2017/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm line 20.
BEGIN failed--compilation aborted at /usr/local/texlive/2017/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm line 20.
Compilation failed in require at /usr/local/texlive/2017/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm line 19.
BEGIN failed--compilation aborted at /usr/local/texlive/2017/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm line 19.
Compilation failed in require at /usr/local/texlive/2017/texmf-dist/scripts/latexindent/LatexIndent/Document.pm line 25.
BEGIN failed--compilation aborted at /usr/local/texlive/2017/texmf-dist/scripts/latexindent/LatexIndent/Document.pm line 25.
Compilation failed in require at /Library/TeX/texbin/latexindent line 27.
BEGIN failed--compilation aborted at /Library/TeX/texbin/latexindent line 27.
Any clue what I can do now? Perl 5.18, macOS Sierra 10.12.6.
The first line looks like the clue. Tiny.pm isn't installed. Keep in mind, the commands above are specific to my system. Look for your installation of cpan and make sure that the one on your path is running.
Further: don't give me too much credit. I have no idea what the black magic is that makes this all work. I just got luck and figured this out. It was close to a miracle that I did.
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 https://github.com/James-Yu/LaTeX-Workshop/issues/376#issuecomment-381274613 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 :)
I really appreciate you posting what you did. Humorously, I had this problem again, forgot my solution, googled it, and found my post. That's what happens when you get older, and why we write things down, lol. Glad it works.
I had the errors discussed above and installed all the suggested cpan packages. Now I get the following problem:
Cannot write to 'indent.log': Permission denied at /Library/Perl/5.18/Log/Dispatch/File.pm line 100.
I don't know how it all works, but it seems like it's trying to write the file "indent.log" to a location where you are not allowed to. I don't have Log (the directory) on my machine. You might want to look at line 100 of FIle.pm and see where it's trying to write.
Most helpful comment
I got it working, but it might be longer than you are interested in.
You may not need all of them. I got this (the last three lines with my edit of the
cpanmtypo) from https://github.com/ketan/BeautifyLatexI'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::GCStringwhenperl latexindentexecuted in the directory wherelatexindentis located failed.