Cannot locate RT/FM.pm

Hello,

I’ve installed RTFM (RTFM-2.4.1,RT-3.8.1), using

perl Makefile.PL (and path /var/www/mysite/lib as path to RT.pm)

all goes fine, until i add

Set (@plugins,'RT::FM");

and then i get:

[error] Can’t locate RT/FM.pm in @INC (@INC contains:
//var/www/mysite/local/lib //var/www/mysite/lib
/var/www/mysite/bin/…/local/lib /var/www/mysite/bin/…/lib etc…

In system configuration I have

RT::LocalPluginPath /var/www/mysite/local/plugins

but FM.pm is in /var/www/mysite/local/plugins/RT-FM/lib/RT/FM.pm

is that correct?

thanks

Woody.

That leading double slash (//var/…) causes your problems. I think
it’s in lib/RT.pm, you can fix it by hand. Also, 3.8.3rc2 should
handle such things fine.On Fri, May 22, 2009 at 9:04 PM, Woody - Wild Things woody@wildthingsafaris.com wrote:

Hello,

I’ve installed RTFM (RTFM-2.4.1,RT-3.8.1), using

perl Makefile.PL (and path /var/www/mysite/lib as path to RT.pm)

all goes fine, until i add

Set (@plugins,'RT::FM");

and then i get:

[error] Can’t locate RT/FM.pm in @INC (@INC contains:
//var/www/mysite/local/lib //var/www/mysite/lib
/var/www/mysite/bin/…/local/lib /var/www/mysite/bin/…/lib etc…

In system configuration I have

RT::LocalPluginPath /var/www/mysite/local/plugins

but FM.pm is in /var/www/mysite/local/plugins/RT-FM/lib/RT/FM.pm

is that correct?

thanks

Woody.


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Best regards, Ruslan.

Ruslan Zakirov wrote:

That leading double slash (//var/…) causes your problems. I think
it’s in lib/RT.pm, you can fix it by hand.

Thanks Ruslan,

The offending // was found in webmux.pl, but didn’t solve the issue.
However your pointer to RT.pm did allow me to hack a fix:

sub InitPluginPaths {
my $self = shift || PACKAGE;

 my @lib_dirs = $self->PluginDirs('lib');

 my @tmp_inc;
 for (@INC) {
     if ( Cwd::realpath($_) eq $RT::LocalLibPath) {
         push @tmp_inc, $_, @lib_dirs;
     } else {
         push @tmp_inc, $_;
     }
 }
 push @tmp_inc, @lib_dirs; # <------------- added
 my %seen;
 @INC = grep !$seen{$_}++, @tmp_inc;

}

I added the push as the @lib_dirs was not being added to @INC, but now
its not in the correct place i assume - its right at the end.

It works, but I’m sure it would be better to fix the
if ( Cwd::realpath($_) eq $RT::LocalLibPath) {
properly, but that seems so far to be beyond me…

Thanks very much. Now on to configure RTFM :slight_smile:

w.

Richard Wood (Woody)
Managing Director
Wild Thing Safaris Ltd.
PO BOX 34514 DSM
Office: +255 (0) 222 617 166
Mobile: +255 (0) 773 503 502

http://www.wildthingsafaris.com/pub/woody.html

Ruslan Zakirov wrote:

That leading double slash (//var/…) causes your problems. I think
it’s in lib/RT.pm, you can fix it by hand.

Thanks Ruslan,

The offending // was found in webmux.pl, but didn’t solve the issue.
However your pointer to RT.pm did allow me to hack a fix:

sub InitPluginPaths {
my $self = shift || PACKAGE;

my @lib_dirs = $self->PluginDirs('lib');

my @tmp_inc;
for (@INC) {
    if ( Cwd::realpath($_) eq $RT::LocalLibPath) {
        push @tmp_inc, $_, @lib_dirs;
    } else {
        push @tmp_inc, $_;
    }
}
push @tmp_inc, @lib_dirs; # <------------- added
my %seen;
@INC = grep !$seen{$_}++, @tmp_inc;

}

I added the push as the @lib_dirs was not being added to @INC, but now
its not in the correct place i assume - its right at the end.

It works, but I’m sure it would be better to fix the
if ( Cwd::realpath($_) eq $RT::LocalLibPath) {
properly, but that seems so far to be beyond me…

Could you please add something like that to that code, before “for” loop:

use Data::Dumper;
warn "INC: ". Dumper @INC;
warn "local lib path: ". $RT::LocalLibPath;

Then stop/start server. In apache’s error log you should see this
entries. This can help us debug issue.

FYI, with your change files in local/lib wouldn’t override matching
libraries of plugins.

Thanks very much. Now on to configure RTFM :slight_smile:

w.

Richard Wood (Woody)
Managing Director
Wild Thing Safaris Ltd.
PO BOX 34514 DSM
Office: +255 (0) 222 617 166
Mobile: +255 (0) 773 503 502

http://www.wildthingsafaris.com
http://www.wildthingsafaris.com/pub/woody.html


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Best regards, Ruslan.

Ruslan Zakirov wrote:

Could you please add something like that to that code, before “for” loop:

use Data::Dumper;
warn "INC: ". Dumper @INC;
warn "local lib path: ". $RT::LocalLibPath;

Then stop/start server. In apache’s error log you should see this
entries. This can help us debug issue.

Hi Ruslan,

Sorry for the delay.
Here is the first 3 dumps

INC: $VAR1 = [
‘/var/www/rt.mysite.com/local/lib’,
‘/var/www/rt.mysite.com/lib’,
‘/var/www/cms-live/modules’,
‘/var/www/cms-live/modules/planner’,
‘/var/www/rt.mysite.com/bin/…/local/lib’,
‘/var/www/rt.mysite.com/bin/…/lib’,
‘/home/httpd/perl’,
‘/etc/perl’,
‘/usr/lib/perl5/vendor_perl/5.8.8/i486-linux’,
‘/usr/lib/perl5/vendor_perl/5.8.8’,
‘/usr/lib/perl5/vendor_perl’,
‘/usr/lib/perl5/site_perl/5.8.8/i486-linux’,
‘/usr/lib/perl5/site_perl/5.8.8’,
‘/usr/lib/perl5/site_perl’,
‘/usr/lib/perl5/5.8.8/i486-linux’,
‘/usr/lib/perl5/5.8.8’,
‘/usr/local/lib/site_perl’,
‘.’,
‘/usr/lib/apache2’
];
local lib path: /var/www/rt.mysite.com/local/lib at
/var/www/rt.mysite.com/lib/RT.pm line 605.
INC: $VAR1 = [
‘/var/www/rt.mysite.com/local/lib’,
‘/var/www/rt.mysite.com/lib’,
‘/var/www/cms-live/modules’,
‘/var/www/cms-live/modules/planner’,
‘/var/www/rt.mysite.com/bin/…/local/lib’,
‘/var/www/rt.mysite.com/bin/…/lib’,
‘/home/httpd/perl’,
‘/etc/perl’,
‘/usr/lib/perl5/vendor_perl/5.8.8/i486-linux’,
‘/usr/lib/perl5/vendor_perl/5.8.8’,
‘/usr/lib/perl5/vendor_perl’,
‘/usr/lib/perl5/site_perl/5.8.8/i486-linux’,
‘/usr/lib/perl5/site_perl/5.8.8’,
‘/usr/lib/perl5/site_perl’,
‘/usr/lib/perl5/5.8.8/i486-linux’,
‘/usr/lib/perl5/5.8.8’,
‘/usr/local/lib/site_perl’,
‘.’,
‘/usr/lib/apache2’
];
local lib path: /var/www/rt.mysite.com/local/lib at
/var/www/rt.mysite.com/lib/RT.pm line 605.
INC: $VAR1 = [
‘/var/www/rt.mysite.com/local/lib’,
‘/var/www/rt.mysite.com/lib’,
‘/var/www/cms-live/modules’,
‘/var/www/cms-live/modules/planner’,
‘/var/www/rt.mysite.com/bin/…/local/lib’,
‘/var/www/rt.mysite.com/bin/…/lib’,
‘/home/httpd/perl’,
‘/etc/perl’,
‘/usr/lib/perl5/vendor_perl/5.8.8/i486-linux’,
‘/usr/lib/perl5/vendor_perl/5.8.8’,
‘/usr/lib/perl5/vendor_perl’,
‘/usr/lib/perl5/site_perl/5.8.8/i486-linux’,
‘/usr/lib/perl5/site_perl/5.8.8’,
‘/usr/lib/perl5/site_perl’,
‘/usr/lib/perl5/5.8.8/i486-linux’,
‘/usr/lib/perl5/5.8.8’,
‘/usr/local/lib/site_perl’,
‘.’,
‘/usr/lib/apache2’,
‘/var/www/rt.mysite.com/local/plugins/RTx-Calendar/lib’,
‘/var/www/rt.mysite.com/local/plugins/RT-FM/lib’,

‘/var/www/rt.mysite.com/local/plugins/RT-Extension-MandatorySubject/lib’,
‘/var/www/rt.mysite.com/local/plugins/RTx-EmailCompletion/lib’
];
local lib path: /var/www/rt.mysite.com/local/lib at
/var/www/rt.mysite.com/lib/RT.pm line 605.

FYI, with your change files in local/lib wouldn’t override matching
libraries of plugins.

yes, I see that as a prob.

thanks for your help.

Woody.

Richard Wood (Woody)
Managing Director
Wild Thing Safaris Ltd.
PO BOX 34514 DSM
Office: +255 (0) 222 617 166
Mobile: +255 (0) 773 503 502

http://www.wildthingsafaris.com/pub/woody.html