0

I have some modules installed through local lib. This is because I don't have root access. Now I'm trying to use those modules in a Jenkins Job. At the moment when I run Jenkins, it complains about not finding my Perl modules which are installed in my local lib.

Can't locate Devel/Cover.pm in @INC (you may need to install the Devel::Cover module)     (@INC contains: usr/bin/perl

I have this module installed in /home/mattias/perl5/lib/perl5/

The things I have tried to fix this is:

1 Change PERL5LIB in Jenkins with the help of a string parameter:

 RUN_CMD
 export PERL5LIB= /home/mattias/perl5/lib/perl5

2 Using the -I flag when I run the script

perl -I -MDevel::Cover /home/mattias/script.pl

Since I dont have access to Jenkins @INC I can't add the modules there. It has to go through my local lib. The most important module that is needed to be used is Devel::Cover.

Anyone have any suggestions?

// Mattias

Mattias
  • 13
  • 4

1 Answers1

0

At the moment when I run Jenkins, it complains about not finding my Perl modules which are installed in local::lib.

local::lib is not a valid unix directory. What is the exact path where you installed the module Devel::Cover? You will have to add that path to @INC. Here's how.

You can also put in your Perl program:

use lib '/usr/lib/mymodules/'; # Appends path to @INC at compile time.
use Devel::Cover;
Community
  • 1
  • 1
Bulrush
  • 548
  • 2
  • 4
  • 19
  • Ok. So my module (Cover.pm) is in /home/mattias/perl5/lib/perl5/Devel/Cover.pm. My @INC have the path to this module and therefore the script works when I run it locally via the terminal. But since Jenkins is running as another user it complains about not finding Cover.pm. I tried to add "use lib '/home/mattias/perl5/lib/perl5/Devel/Cover.pm' in the Perl program but still got the same error message. – Mattias Jul 17 '14 at 14:30