16

I'm trying to install XML::Simple module however I get the following everytime.

cpan install XML::Simple
Going to read '/root/.cpan/Metadata'
Database was generated on Wed, 12 Mar 2014 09:17:02 GMT
Running install for module 'XML::Simple'
Running make for G/GR/GRANTM/XML-Simple-2.20.tar.gz
Checksum for /root/.cpan/sources/authors/id/G/GR/GRANTM/XML-Simple-2.20.tar.gz ok

CPAN.pm: Going to build G/GR/GRANTM/XML-Simple-2.20.tar.gz

Checking if your kit is complete...
Looks good
Writing Makefile for XML::Simple
Writing MYMETA.yml
GRANTM/XML-Simple-2.20.tar.gz
make -- NOT OK
'YAML' not installed, will not store persistent state
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible

Can anyone tell me what is problem here? and how to fix it?

kenorb
  • 155,785
  • 88
  • 678
  • 743
Deano
  • 11,582
  • 18
  • 69
  • 119
  • Do you have `make` and `YAML` installed? – blueygh2 Mar 12 '14 at 18:06
  • 1
    Looks like you don't have `make` installed. Is this on a PC, or is this on Linux? If it's Linux, you have to make sure you have the C programming tools installed. If this is Windows, and you're not using [Strawberry Perl](http://strawberryperl.com), use Strawberry Perl. It comes with the MIGW environment which includes `make` and `gcc` and all the libraries you need. – David W. Mar 12 '14 at 18:12
  • I'm using linux btw, and after installing make I'm able to download modules. – Deano Mar 12 '14 at 19:13
  • 2
    On a debian-based distro you could also do `sudo apt-get install libxml-simple-perl`. And LeoNerd is correct don't use XML::Simple - I wrote it and I recommend XML::LibXML instead :-) – Grant McLean Mar 12 '14 at 20:26
  • Thanks Grant! Good job on the module! – Deano Mar 13 '14 at 23:33

3 Answers3

36

Try installing YAML directly via cpan, e.g.:

cpan YAML

Source: Re: Installing from CPAN -- YAML

kenorb
  • 155,785
  • 88
  • 678
  • 743
16

This is one of those unclear error messages you get. The true problem is almost certainly that you don't have make installed. If this is a Debian-like box, you want to

$ sudo apt-get install build-essential

or local equivalent for other OSes.

On a side note, you don't want to be using XML::Simple either. Try one of the many other variations on XML reading/writing from CPAN.

amon
  • 57,091
  • 2
  • 89
  • 149
LeoNerd
  • 8,344
  • 1
  • 29
  • 36
1

On the CPAN command line

> install YAML
PodTech.io
  • 4,874
  • 41
  • 24