Open faelin opened 4 years ago
UPDATE: rm -rf $(plenv root) && brew reinstall plenv
has fixed the issue for now. However, this means I will have to reinstall every perl version that I want, and all relevant modules.
"system" perl has correctly configured httpS support, but if you've switched to another plenv version, you'll need to install https support for that version:
plenv install-cpanm
cpanm Mozilla::CA
cpanm LWP
cpanm LWP::Protocol::https
Reinstalling plenv didn't work for me, but following @douglasdd's instructions did. I had to find where plenv had installed cpanm and manually run perl /usr/local/Cellar/perl/5.30.2_1/lib/perl5/site_perl/5.30.2/App/cpanminus/fatscript.pm
instead of just plain cpanm
.
Same issue here on Debian under WSL2 with a fresh installed plenv and perl-build.
I get this error when installing "fresh" on Mac (Mojave, 10.14.6) with Homebrew:
brew install cpanminus perl-build plenv
eval "$( plenv init )"
plenv install -l
Available versions:
No backend configured for scheme https at /usr/local/Cellar/perl-build/1.32/libexec/lib/perl5/CPAN/Perl/Releases/MetaCPAN.pm line 48.
The workaround by douglasdd fixes it, by installing those libraries to the "main" Homebrew-managed Perl that runs Plenv. - is this "official"? Maybe it should be part of the setup instructions, or Plenv should include it as some kind of setup script.
I get this error when installing "fresh" on Mac (Mojave, 10.14.6) with Homebrew:
I ran into the same issue while setting up a WSL environment with brew
. Additionally, LWP::Protocol::https
failed because its dependency Net::SSLeay
needed two dev packages missing from my system, as discussed on PerlMonks.
The solution was, as noted in that thread, to run the following before re-attempting LWP::Protocol::https
sudo apt install libssl-dev
sudo apt install zlib1g-dev
I was still on system perl at the time within plenv.
EDIT: I spoke too soon. That still didn't allow plenv install -l
or perl-build --definitions
to work. There are two issues:
perl-build
homebrew formula depends on the perl
homebrew formula (rather than using the OS perl if available), and that version of perl does not come configured with the three packages mentioned by @douglasdd. It also doesn't install a matching version of cpanm
(naturally) so the OS copy was happily installing modules elsewhere.local::lib
, which my OS cpanm
wanted anyway. Unfortunately the perl-build
wrapper script sets $PERL5LIB
to its internal execlib without appending the old value. This meant it was never invoking perl with my local lib in @INC
.I'm not experienced enough with perl dependency management to know whether it's proper to include pre-existing values of $PERL5LIB
; if not, perhaps the brew formula should be updated to use the self-contained distribution with all non-core dependencies bundled in? Or to remove the hard dependency on brew's perl
and rely on the OS to have the right configuration. Which does seem to be the assumption upthread.
The perl
formula strongly recommends local::lib because the Cellar's lib will get blown away upon upgrading, but doesn't enforce that. That probably disqualifies a third option to add cpanm
as a brew dependency and invoke that to install the packages on installation. It probably also disqualifies appending old $PERL5LIB unless also adding a caveat doubling down on the importance of local::lib.
TL;DR: the final workaround was to run brew install cpanm
, ensure local::lib was inactive just in case, and then pull those aforementioned packages into the Cellar's perl lib, after which perl-build
functioned without needing to see my local::lib. I then confirmed that plenv install -l
functions as expected both before and after enabling local::lib.
My goal today was to get self-contained perl libs from day one on my new machine so I didn't have to learn all the variables that go into locating a dependency. Oops 🤣
Actually, maybe the most foolproof option would be as follows:
cpanminus
as a formula dependencycpanm -l ./libexec --self-contained Mozilla::CA LWP LWP::Protocol::https
orcpan -l ./libexec --installdeps --self-contained .
That allows the project to pull the most up to date version of the deps at buildtime, prevents breaking when the perl
formula upgrades, and avoids relying on the user following the local lib advice.
Perl: 5.30.0 OS: Mac OS X (Mojave) 10.14.6 plenv 2.2.0 (maybe??? see #162)
plenv or modules that it depends on seem to be having issues. My primary concern is that plenv seems to be unable to use https to contact the cpan servers.