s2i-perl-container icon indicating copy to clipboard operation
s2i-perl-container copied to clipboard

Installed perl modules are not accessible in script

Open frenzymind opened this issue 5 years ago • 3 comments

I have script begins with: `#!/usr/bin/perl

use strict; use warnings;

use Math::Round; use utf8; use XML::LibXML::Reader; `

cpanfile file: requires 'Math::Round', '== 0.06'; requires 'XML::LibXML::Reader', '== 2.0132';

Both located in tests2i folder, inside this folder I run command: s2i build . centos/perl-526-centos7 test-cos

Build log here:

---> Installing application source ... ---> Installing modules from cpanfile ... --> Working on Module::CoreList Fetching http://www.cpan.org/authors/id/B/BI/BINGOS/Module-CoreList-5.20181020.tar.gz ... OK Configuring Module-CoreList-5.20181020 ... OK Building Module-CoreList-5.20181020 ... OK Successfully installed Module-CoreList-5.20181020 (upgraded from 5.20171120) 1 distribution installed --> Working on . Configuring /opt/app-root/src ... OK ==> Found dependencies: XML::LibXML::Reader, Math::Round --> Working on XML::LibXML::Reader Fetching http://www.cpan.org/authors/id/S/SH/SHLOMIF/XML-LibXML-2.0132.tar.gz ... OK Configuring XML-LibXML-2.0132 ... OK ==> Found dependencies: XML::SAX, XML::SAX::Exception, XML::SAX::Base, XML::NamespaceSupport --> Working on XML::SAX Fetching http://www.cpan.org/authors/id/G/GR/GRANTM/XML-SAX-1.00.tar.gz ... OK Configuring XML-SAX-1.00 ... OK ==> Found dependencies: XML::NamespaceSupport, XML::SAX::Base --> Working on XML::NamespaceSupport Fetching http://www.cpan.org/authors/id/P/PE/PERIGRIN/XML-NamespaceSupport-1.12.tar.gz ... OK Configuring XML-NamespaceSupport-1.12 ... OK Building XML-NamespaceSupport-1.12 ... OK Successfully installed XML-NamespaceSupport-1.12 --> Working on XML::SAX::Base Fetching http://www.cpan.org/authors/id/G/GR/GRANTM/XML-SAX-Base-1.09.tar.gz ... OK Configuring XML-SAX-Base-1.09 ... OK Building XML-SAX-Base-1.09 ... OK Successfully installed XML-SAX-Base-1.09 Building XML-SAX-1.00 ... OK Successfully installed XML-SAX-1.00 Building XML-LibXML-2.0132 ... OK Successfully installed XML-LibXML-2.0132 --> Working on Math::Round Fetching http://backpan.perl.org/authors/id/G/GR/GROMMEL/Math-Round-0.06.tar.gz ... OK Configuring Math-Round-0.06 ... OK Building Math-Round-0.06 ... OK Successfully installed Math-Round-0.06 <== Installed dependencies for .. Finishing. 5 distributions installed Build completed successfully

It seems ok, dependencies found and installed. I run container: docker run -d -p 8080:8080 test-cos

and exec bash. Inside I try: perl zapret.pl

thats give error:

Can't locate Math/Round.pm in @INC (you may need to install the Math::Round module) (@INC contains: /opt/rh/rh-perl526/root/usr/local/lib64/perl5 /opt/rh/rh-perl526/root/usr/local/share/perl5 /opt/rh/rh-perl526/root/usr/lib64/perl5/vendor_perl /opt/rh/rh-perl526/root/usr/share/perl5/vendor_perl /opt/rh/rh-perl526/root/usr/lib64/perl5 /opt/rh/rh-perl526/root/usr/share/perl5) at zapret.pl line 6. BEGIN failed--compilation aborted at zapret.pl line 6.

What do I do wrong ?

frenzymind avatar Nov 07 '18 06:11 frenzymind