我想要在Debian上安装GrowthForecast

我想在Debian上安装GrowthForecast。

创建增长预测用户

我决定创建一个名为growthforecast的用户,并将与GrowthForecast相关的文件放置在/home/growthforecast目录中。

harukasan$ sudo useradd -r -m -s /bin/bash growthforecast

安装Perl 5

在GrowthForecast中,推荐使用其他方式而不是系统自带的Perl进行安装。尝试使用perlbrew来安装Perl。

harukasan$ sudo su - growthforecast
growthforecast$ \wget -O - http://install.perlbrew.pl | bash
growthforecast$ source perl5/perlbrew/etc/bashrc
growthforecast$ echo "source /home/growthforecast/perl5/perlbrew/etc/bashrc" >> ~/.bashrc

所以,我使用perlbrew安装Perl 5。
一开始尝试安装Perl 5.19.3时遇到了测试问题,搞不太清楚,所以我安装了Perl 5.18.1。我对Perl并不太熟悉。

5.19版的Perl是开发版,所以5.18版才是正确的。

growthforecast$ perlbrew install perl-5.18.1

因为需要花费时间,所以我就悠闲地吃个午餐再回来。

安装Cpanm

当您吃完午饭后,我认为Perl已成功安装,需要安装cpanm。

growthforecast$ perlbrew switch perl-5.18.1
growthforecast$ perlbrew install-cpanm

安装GrowthForecast。

由于直接安装会出现错误,请安装所需的软件包。
可以通过错误日志推测出所需的软件包。

harukasan$ sudo aptitude install  libcairo2-dev libpango1.0-dev libxml2-dev
growthforecast$ cpanm -n GrowthForecast

试着启动

使用growthforecast.pl命令进行启动试试。

$ growthforecast.pl --data-dir /home/growthforecast/data &

可以尝试访问http://localhost:5125/来确认是否启动成功。
要将其变为守护进程,需要准备init.d脚本,但由于内容较长,我们可以选择在另一个机会讨论。