本地 cpan 构建
我想使用主目录特定的非根目录来存放从 cpan 安装的内容。我该如何配置它?
正常的 CPAN 配置尝试将软件包安装到 /usr
中。添加 'makepl_arg' => 后q[PREFIX=~/cpan_local]
,简单的包似乎可以构建,但我无法构建提取其依赖项的包 - 找不到依赖项。
我将其更改为 'makepl_arg' => 后q[PREFIX=~/cpan_local LIB=~/cpan_local]
,我收到以下消息: 警告:先决条件 'ExtUtils::CBuilder => 'D/DA/DAGOLDEN/Module-Build-0.3607.tar.gz' 的 0.27' 已安装,但安装看起来很可疑。跳过另一次安装尝试,以防止无限循环。
我如何正确配置它?我希望构建的所有内容都能自动对 ~/cpan_local
执行。 (或者对于熟悉 python 的人来说,我希望它像 virtual-env 一样工作并从中运行 easy_install)。
I'd like to use a home directory specific, non-root directory for stuff I install from cpan. How can I configure it?
Normal CPAN configuration tries to install packages into /usr
. After adding 'makepl_arg' => q[PREFIX=~/cpan_local]
, simple packages seem to build, but I cannot build a package that pulls its dependencies - the dependency is not found.
After I changed it to 'makepl_arg' => q[PREFIX=~/cpan_local LIB=~/cpan_local]
, I get the following message: Warning: Prerequisite 'ExtUtils::CBuilder => 0.27' for 'D/DA/DAGOLDEN/Module-Build-0.3607.tar.gz' already installed but installation looks suspicious. Skipping another installation attempt, to prevent looping endlessly.
How can I configure this properly? I want everything that's built to do to ~/cpan_local
automatically. (or for people familiar with python, I'd like this to work like virtual-env
and running easy_install
from it).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
更好的是,首先安装 App::cpanminus。然后只需使用它作为普通用户安装模块即可。如果该用户无法写入
/usr/local/lib/perl*
目录,它将诉诸于写入其主目录,或者您向其传递-l
或--local-lib
选项直接将其安装在您的主目录中,而无需确定是否可以在系统范围内安装它们。最后,安装 local::lib 并使用
自动设置环境。 bashrc
文件将允许您省略--local-lib
选项并直接安装到您的主目录。Even better, install App::cpanminus first. Then just use it to install modules as a regular user. If this user can't write to the
/usr/local/lib/perl*
directories it will resort to writing in its home directory, or you pass it the-l
or--local-lib
option to directly install it in your home directory without it figuring out if it can install them system wide.Finally, installing local::lib and setting up your environment automatically with your
.bashrc
file will allow you to omit the--local-lib
option and install to your home directory directly.使用 local::lib。引导指令应该可以满足您的需要。
Use local::lib. The bootstrap instructions should do the trick for you.