1

I installed W3C Validator on my Mac OS X Yosemite. I followed these instructions: https://validator.w3.org/docs/install.html

Here is the command I tried:

/usr/local/validator/cgi-bin/check uri=http://www.w3.org

I am getting this error:

<h1>Software error:</h1>
<pre>Can't locate Config/General.pm in @INC (you may need to install the Config::General module) (@INC contains: /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.2 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18) at /usr/local/validator/cgi-bin/check line 47.
BEGIN failed--compilation aborted at /usr/local/validator/cgi-bin/check line 47.
</pre>
<p>
For help, please send mail to this site's webmaster, giving this error message 
and the time and date of the error.

</p>
[Thu Jun 25 01:04:18 2015] check: Can't locate Config/General.pm in @INC (you may need to install the Config::General module) (@INC contains: /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.2 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18) at /usr/local/validator/cgi-bin/check line 47.
[Thu Jun 25 01:04:18 2015] check: BEGIN failed--compilation aborted at /usr/local/validator/cgi-bin/check line 47.

check line 47:

use Config::General 2.32 qw();    # Need 2.32 for <msg 0>, rt.cpan.org#17852

I did a search on my computer for:

sudo find / -name General.pm

I got this this result:

/Applications/Validator-SAC.app/Contents/Resources/validator/lib/perl5.10/Config/General.pm
/Applications/Validator-SAC.app/Contents/Resources/validator/lib/perl5.10.0/Config/General.pm
/Applications/Validator-SAC.app/Contents/Resources/validator/lib/perl5.12/Config/General.pm
/Applications/Validator-SAC.app/Contents/Resources/validator/lib/perl5.18/Config/General.pm
find: /dev/fd/3: Not a directory find: /dev/fd/4: Not a directory
/System/Library/Perl/Extras/5.16/Config/Any/General.pm
/System/Library/Perl/Extras/5.18/Config/Any/General.pm
/Users/jeannicolas/.cpan/build/Config-General-2.58-ICngmR/blib/lib/Config/General.pm
/Users/jeannicolas/.cpan/build/Config-General-2.58-ICngmR/General.pm
/Users/jeannicolas/.cpan/build/Config-General-2.58-umQC4D/blib/lib/Config/General.pm
/Users/jeannicolas/.cpan/build/Config-General-2.58-umQC4D/General.pm
/Users/jeannicolas/perl5/lib/perl5/Config/General.pm
/usr/local/Cellar/autoconf/2.69/share/autoconf/Autom4te/General.pm
/usr/local/Cellar/automake/1.14/share/automake-1.14/Automake/General.pm

More details about my setup for perl:

$  which perl

/usr/bin/perl

$  perl --version

This is perl 5, version 18, subversion 2 (v5.18.2) built for darwin-thread-multi-2level (with 2 registered patches, see perl -V for more detail)

Copyright 1987-2013, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page.

How can I solve this?

stevenl
  • 6,736
  • 26
  • 33
jnbdz
  • 4,863
  • 9
  • 51
  • 93
  • You have two versions of Perl installed, 5.10 and 5.18. I can see 5.18 is running from command line, but do you know which version the web server is running? Looks like Config::General installed ok for 5.10, but for 5.18 it's in an odd place: /Users/jeannicolas/perl5/lib/perl5/Config/General.pm . Is your @INC array set up to include this in the path for included library modules? – Kim Ryan Jun 25 '15 at 10:39
  • 1
    I have no experience with Perl... I have no idea if my @INC array is setup to include this in the path for included library modules. – jnbdz Jun 25 '15 at 12:43
  • Don't know how you installed the extra librareies, but from this "/Users/jeannicolas/perl5/lib/perl5/Config/General.pm" looks like it hasn't gone to the normal place such as /System/Library/Perl/Extras/ May not be possible, but if you could wipe and reinstall perl and all the modules, it should work a lot better and you don't have to worry about @INC and $PERL5LIB – Kim Ryan Jun 26 '15 at 06:38

1 Answers1

0

I had the same problem, and got past it by simply adding sudo when invoking cpan — not just for Config::General, but for all the dependencies:

sudo cpan install Bundle::W3C::Validator

Having done that, the w3c validator now works fine for me.

I’m not knowledgeable enough to be confident whether this is a good approach. In other contexts, one’s often warned against installing things with sudo. Various people (e.g. the answers to this question) suggest that it’s OK to use sudo for cpan in general; however, they don’t discuss the Mac OS X context specifically. This question gives an alternative possibility (telling cpan to install to a different location), but I didn’t find it until after already falling back on sudo.

Community
  • 1
  • 1
PLL
  • 1,572
  • 1
  • 13
  • 21