【问题标题】:Installation of modules Perl 6 failed - No compiler available for Perl v6.cPerl 6 模块安装失败 - Perl v6.c 没有可用的编译器
【发布时间】:2017-08-05 23:36:18
【问题描述】:

我通过以下方式安装了 Perl 6 解释器 Rakudo:

sudo apt-get install rakudo

我正在关注有关安装 Perl 6 模块的教程:

http://perl6maven.com/how-to-install-perl6-modules

在最后一步我得到了这个错误:

perl6 bootstrap.pl===SORRY!=== Error while compiling /home/daniel/test/panda/bootstrap.pl
No compiler available for Perl v6.c
at /home/daniel/test/panda/bootstrap.pl:3
------> use v6.c⏏;

版本信息:

Ubuntu 16.04.2 LTS
This is perl6 version 2015.11 built on MoarVM version 2015.11

如何安装缺少的编译器?

【问题讨论】:

  • Perl 6 作为标准的第一个版本是在 2015 年 12 月,您有一个上个月的 Rakudo。

标签: perl-module raku rakudo


【解决方案1】:

警告:此解决方案可用于开发,但对于生产,建议手动编译解释器,直到 Ubuntu 存储库不会更新。

链接教程中描述的Panda 已贬值。我应该使用zef 来安装 Perl 模块。

我的 Perl 版本太旧了。我在阅读issue 380 关于不工作版本6.c 后意识到这一点。

关于在Ubuntu 上安装最新Perl 6.c 的正确教程在这里:

http://linuxtot.com/installing-perl-6-on-debian-or-ubuntu/

现在我的rakudo -v 打印:

This is Rakudo version 2017.07-132-gabf1cfe built on MoarVM version 2017.07-318-g604da4d
implementing Perl 6.c.

一切都很好。


以下命令摘自下面链接的a tutorial

apt-get install build-essential git libssl-dev
git clone https://github.com/tadzik/rakudobrew ~/.rakudobrew
echo 'export PATH=~/.rakudobrew/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
rakudobrew build moar
rakudobrew build zef

现在安装perl6 模块:

zef install Module::Name

【讨论】:

  • 警告 对于那些阅读本文的人......我已经对@Daniel 的问题和答案都投了赞成票,但他们的回答是有问题的。他们的回答显然正确识别了他们遇到的问题(旧安装程序和旧 P6 版本)。他们链接的教程也让他们找到了解决方案。但是本教程涉及到 rakudobrew 的使用。 rakudobrew 是一个脆弱的“快速而肮脏”的工具,适用于核心开发人员,而不是普通用户。我在a recent reddit comment of mine 中对此进行了详细解释。
  • 如果您不关心生产部署,而是希望在家中开始使用 Perl 6,跟踪最新版本,那么 rakudobrew 完全没问题。将其描述为“又快又脏”是不诚实的。它并不比许多人用来取得巨大成功的 perlbrew 更脆弱。对于生产部署,总是有更多内容。这里值得强调的更大问题是 Ubuntu LTS 有一个不符合已发布规范的 ancient 版本的 Rakudo。
【解决方案2】:

如果您愿意从源代码安装自己的软件,请尝试以下操作(从https://rakudo.perl6.org/downloads/star/ 更新最新 Rakudo Star 的 URL):

wget -O rakudo-star-2017.07.tar.gz https://rakudo.perl6.org/downloads/star/rakudo-star-2017.07.tar.gz
tar -xvf rakudo-star-2017.07.tar.gz
cd rakudo-star-2017.07
perl Configure.pl --backend=moar --gen-moar
make
make rakudo-test
make install

然后将以下路径添加到您的$PATH(当然,用实际路径替换/path/to):

/path/to/rakudo-star-2017.07/install/bin
/path/to/rakudo-star-2017.07/install/share/perl6/site/bin

我为此使用了一个模块文件:

#%Module1.0
## Metadata ###########################################
set this_module   rakudo-star
set this_version  2017.07
set this_root     /path/to/$this_module/$this_module-$this_version/install
set this_docs     http://rakudo.org/documentation/

#######################################################
## Module #############################################
proc ModulesHelp { } {
        global this_module this_version this_root this_docs
        puts stderr "$this_module $this_version"
        puts stderr "****************************************************"
        puts stderr " $this_docs"
        puts stderr "****************************************************\n"
}

module-whatis   "Set up environment for $this_module $this_version"

prepend-path  PATH  $this_root/bin
prepend-path  PATH  $this_root/share/perl6/site/bin

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多