Installation

error check_modules.pl apache2

error check_modules.pl apache2

by L Ng -
Number of replies: 8

Almost there getting to install WW...

What does this mean and how would I resolve this? Running RHEL 8 by the way

Can't locate version.pm in @INC (you may need to install the version module) (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at /opt/webwork/webwork2/bin/check_modules.pl line 40.

BEGIN failed--compilation aborted at /opt/webwork/webwork2/bin/check_modules.pl line 40.

Thank you.


In reply to L Ng

Re: error check_modules.pl apache2

by L Ng -
YET, when I run this as sudo bash/root, I get a different error

$ check_modules.pl apache2
bash: check_modules.pl: command not found
In reply to L Ng

Re: error check_modules.pl apache2

by Adam Chandler -
You will need to make sure check_modules.pl is executable. If you can confirm that you will just need to put "./" in front of the file name if you are in the directory with the script. If you are in a different directory you will need to provide the full address to the directory:
$./check_modules.pl apache2

or

$/opt/webwork/webwork2/bin/check_modules.pl apache2
In reply to L Ng

Re: error check_modules.pl apache2

by Michael Gage -

When you try to run

./check_modules.pl

from the command line the first line of the file

#!/usr/bin/env perl

tries to find the perl program to run this. It's pretty good but not perfect at finding the correct version of perl.

When you run as root you have a different environment than when you run as a non-privileged user so the results can be different.  'root' may not have the same defaults you are expecting.

Instead you can always use

/path/to/my/custom/perl   check_modules.pl

which overrides the #!/user/bin/env perl line

This is true of a number of command line scripts in webwork2/bin -- and they are not consistent  in how they try to access the program that should run them.  If something seems not to be working properly, try to specify exactly the program that should call the script.


In reply to Michael Gage

Re: error check_modules.pl apache2

by L Ng -

wait a sec.. don't I need to install perl first then the pearl brew?

In reply to L Ng

Re: error check_modules.pl apache2

by Andrew Parker -

RHEL provides a standard version of perl.

perlbrew aids with the configuration, creation, and management of multiple perl versions. I advise using perl-5.20

In order to take advantage of perlbrew's management features, you must enable it in the shell.

Once enabled in the shell, the `perl` command will be routed behind-the-scenes to whichever version of perl you have selected with `perlbrew use`

This means that running `check_modules.pl` should use that same `perl`

What do you see in this section of check_modules output?

```

@INC=     /usr/local/perlbrew/perls/perl-5.20.3-thread-multi/lib/site_perl/5.20.3/x86_64-linux-thread-multi

     /usr/local/perlbrew/perls/perl-5.20.3-thread-multi/lib/site_perl/5.20.3

     /usr/local/perlbrew/perls/perl-5.20.3-thread-multi/lib/5.20.3/x86_64-linux-thread-multi

     /usr/local/perlbrew/perls/perl-5.20.3-thread-multi/lib/5.20.3

```

Here you can see the use of perlbrew behind the scenes. It directs @INC to look for modules in the subfolders of the perl version managed by perlbrew.

In reply to Andrew Parker

Re: error check_modules.pl apache2

by L Ng -
I actually got it to work but missing some items... need to figure out how to install them.. I started from scratch.. good learning opportunity i don't mind
In reply to L Ng

Re: error check_modules.pl apache2

by Adam Chandler -
You are going to need to run the command with the full path to the custom perl install it should be installed in the default perlbrew location if you followed the instructions. In stead of running the command starting with "perl" start it with "/usr/local/perlbrew/perls/perl-5.20.3/bin/perl " and you should get the perlbrew version with all of the modules you have installed.
Example:

$/usr/local/perlbrew/perls/perl-5.20.3/bin/perl /opt/webwork/webwork2/bin/addcourse admin --db-layout=sql_single --users=adminClasslist.lst --professors=admin

That command should successfully create the admin course.
In reply to Adam Chandler

Re: error check_modules.pl apache2

by Andrew Parker -

If you add the perlbrew “source” instruction to your .bashrc, and reload your shell, perlbrew will handle the paths for you.

In order to be persistent, the last line needs to be added to the `.bashrc` file for the wwadmin user: /home/wwadmin/.bashrc; and should also be added for the root user as well. Instead of adding to each users' .bashrc separately, in RHEL the command can be added to /etc/bashrc, where it will be applied to all users when they log in.