I was trying to install a perl module lately and I got through this error. I was trying to install Math:Combinatorials
robern@robern-laptop:/media/EE6A5C156A5BD8C3/Users/ROBERN/Desktop/iiit/LTRC_work/math_combinatory_perl/Math-Combinatorics-0.09$ make install
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ERROR: Can't create '/usr/local/man/man3'
mkdir /usr/local/man/man3: Permission denied at /usr/share/perl/5.10/ExtUtils/Install.pm line 479
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
at -e line 1
make: *** [pure_site_install] Error 13
If you don't have root permission you will not be able to install a module in the usual place on a shared user system. If you do not have root access you may get errors like:
This is easy to get around. You just install it locally in your home directory. Make a directory called say /lib in your home directory like this:
# first navigate to your home directory
$ cd ~
# now make a directory called lib
# on UNIX
$ mkdir lib
# on Win32
C:\> md lib
Now you have a directory called ~/lib where the ~ represents the path to your home dir. ~ literally means your home dir but you knew that already. All you need to do is add a modifier to your perl Makefile.PL command
$ perl Makefile.PL PREFIX=~/lib LIB=~/lib
This tell MakeMaker to install the files in the lib directory in your home directory. You then just make/nmake as ::
$ make
$ make test
$ make install
To use the module you just need to add ~/lib to @INC. See Simple Module Tutorial for full details of how. In a nutshell the top of your scripts will look like this:
#!/usr/bin/perl -w
use strict;
# add your ~/lib dir to @INC
use lib '/usr/home/your_home_dir/lib/';
# proceed as usual
use Some::Module;
No comments:
Post a Comment