0

I tried brew update and after the Heroku autocomplete installation I started getting the following error. How can I solve this issue?

Can't locate local/lib.pm in @INC (you may need to install the local::lib module) (@INC contains: /Users/franklin/perl5/lib/perl5 /usr/local/Cellar/perl/5.28.0/lib/perl5/site_perl/5.28.0/darwin-thread-multi-2level /usr/local/Cellar/perl/5.28.0/lib/perl5/site_perl/5.28.0 /usr/local/Cellar/perl/5.28.0/lib/perl5/5.28.0/darwin-thread-multi-2level /usr/local/Cellar/perl/5.28.0/lib/perl5/5.28.0 /usr/local/lib/perl5/site_perl/5.28.0/darwin-thread-multi-2level /usr/local/lib/perl5/site_perl/5.28.0).

BEGIN failed--compilation aborted.

“Can't locate local/lib.pm” Error

Community
  • 1
  • 1
FAntony
  • 534
  • 7
  • 22

1 Answers1

3

It looks like it's trying to use the local::lib Perl module. That creates a Perl library directory in your local directory so you don't have to install modules as root.

I don't know why that tool didn't do that for you (and you should tell those maintainers about that). You can install it yourself though:

I wish this was a bit easier so you could just use a quick cpan command to do it. There's also quite a bit about local::lib on StackOverflow.

Other advice has been to remove an offending line from .bash_profile, but something else in the tool might expect whatever that sets up.

brian d foy
  • 129,424
  • 31
  • 207
  • 592
  • 1
    Both `cpan` and `cpanm` (at least up to date versions of them) will install to the local::lib by default if executed without write access to the Perl's sitelib, this can be used to install local::lib itself. Additionally `cpanm -l ~/perl5 local::lib` will do this regardless of permissions, and a standalone `cpanm` script can be downloaded from https://cpanmin.us. – Grinnz Dec 03 '18 at 18:39
  • I don't think I added that feature to `cpan`, but maybe it's there. It can certainly use it once it's installed. – brian d foy Dec 03 '18 at 19:33