-3

I program using Perl and need to install Unicode String. But make install tells me:

Files found in blib/arch: installing files in blib/lib into architecture dependent library tree !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ERROR: Can't create '/Library/Perl/5.16/darwin-thread-multi-2level/Unicode' mkdir /Library/Perl/5.16/darwin-thread-multi-2level/Unicode: Permission denied at /System/Library/Perl/5.16/ExtUtils/Install.pm line 494.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! at -e line 1. make: *** [pure_site_install] Error 13

Does anyone ever encountered this problem?

Alexander Farber
  • 21,519
  • 75
  • 241
  • 416
Starckman
  • 145
  • 6
  • It seems pretty clear that the user running the `make` does not have permission to create a directory in that place. Change user? Or `sudo`. – TLP Apr 01 '15 at 13:23
  • You need permission to install into `/Library/`. Try with `sudo make install`, or change the installation prefix. – Biffen Apr 01 '15 at 13:23
  • Thx, I tried sudo make install, it says "sudo make install Unicode::string Password: make: *** No rule to make target `install'. Stop". What do you mean by "change the installation prefix?" – Starckman Apr 01 '15 at 13:46
  • The recommendation to use `sudo` maybe well-intentioned, but it is **harmful**. Do not mess with OS X system Perl. Instead, install your own Perl in a user directory, I use `$HOME/perl/5.xx.x`, and use that. See http://www.effectiveperlprogramming.com/2011/02/choose-the-right-perl-distribution/ if you need help. – Sinan Ünür Apr 01 '15 at 14:05

1 Answers1

0

/Library is a system directory. It is a bad idea to tinker with your system's own Perl distribution. If anything goes wrong, you'll have a lot of cleanup to do.

Therefore, build your own Perl. All you need is to download the appropriate source distribution, and run ./Configure --help, and read the instructions.

Or, you could just do:

$ ./Configure -des -Dprefix=/Users/user/perl/5.xx.x
make
make test
make install

You can then put /Users/user/perl/5.xx.x/bin on your path, or just invoke perl with the full path.

 $ ~/perl/5.xx.x/bin/perl Makefile.PL
make test
make install

I like to put symlinks in ~/bin so that perl5.xx.x invokes ~/perl/5.xx.x/bin/perl.

Do not install modules in system directories. I am sure people who recommended that mean well, but doing so is going to cause trouble at some point.

Sinan Ünür
  • 116,958
  • 15
  • 196
  • 339
  • Or better, simply use [perlbrew](http://perlbrew.pl/) – Steffen Ullrich Apr 01 '15 at 14:14
  • @SteffenUllrich I am not in favor of anyone jumping into using `perlbrew` without understanding what it does behind the scenes. And, as much as I wanted to like it, all three times I tried to use it consistently, I ended up wiping `~/perl5` after a while. It doesn't do anything for me. So, better and simply are in the eyes of the beholder. – Sinan Ünür Apr 01 '15 at 14:17
  • 1
    Thx everyone for you response! The problem was it didn't find the module for my currently activeperl (20), i re-downloaded activeperl 18, and re-installed unicode::string using the command /usr/local/ActivePerl-5.18/bin/ppm install Unicode-String, and now it works fine. – Starckman Apr 01 '15 at 17:50