How can I install CPAN modules locally without root access (DynaLoader.pm line 229 error)?

你离开我真会死。 提交于 2019-11-27 02:10:07
Fayland Lam

Personally I would suggest to use local::lib. :)

When you installed the module, did you watch the output? Where did it say it installed the module? Look in lib. Do you see the next directory you expect?

Look in ~/lib to see where eveything ended up to verify that you have the right directory name in your use lib statement:

% find ~/lib -name CSV_XS.so

Once you see where it is installed, use that directory name in your use lib (or PERL5LIB or whatever).

I expect you have a lib/lib in there somehow. The PREFIX is just the, well, prefix, and the installer appends other directory portions to that base path. That includes lib, man, bin, etc.

Frosty

Try this instead:

'makepl_arg' => q[PREFIX=~/]

PREFIX sets the base for all the directories you will be installing into (bin, lib, and so forth.)

You may also be running into shell expansion problems with your '~'. You can try to expand it yourself:

'makepl_arg' => q[PREFIX=/home/users/foobar]

It would also be helpful if you included the commands you used to get the error you are asking about.

It looks from the error message ("at /www/common ...") that your script is a CGI or mod_perl script. The web server is probably not running as the user 'foo', under whose home directory you've installed the module - that could result in the web server being unable to read that directory.

It may also be running in a "chroot jail", which would mean that the directory in which you've installed the module may not be visible to the script.

In other words, just because you can see the module, does not mean that the web server, and therefore your script, can do so. You should check the relevant file permissions, and if the server is chrooted, whether your module directory is mounted within the virtual file system.

Does the file in question (CSV_XS.so) exist?

Does it exist at the listed location?

If you do:

set |grep PERL

What is the output?

Have you successfully installed other local perl modules?

I strongly suggest installing your own perl in your own home directory, if you have space. Then you can keep everything under your control and keep your own module set, as well as escaping if the admins are keeping you on an older version of perl. (Not to mention preserving yourself if they upgrade some day and leave out all the modules you are relying on.)

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!