Reputation: 1
I'm working on a fresh Ubuntu vm, I've imported Mojolicious, Mango and MongoDB all through terminal (apt-gets and curls) but when I try and run any project that implements Mango - using command: morbo project/script/project
It returns the following error:
Couldn't load application from file "project/script/project": "dumper" is not exported by the Mojo::Util module
Can't continue after import errors at /etc/perl/Mango.pm line 10
BEGIN failed--compilation aborted at /etc/perl/Mango.pm line 10.
Compilation failed in require at /home/user/project/script/../lib/project.pm line 3.
BEGIN failed--compilation aborted at /home/user/project/script/../lib/project.pm line 3.
Compilation failed in require at (eval 94) line 1.
The Mojo::Util and Mango.pm are all unedited dependencies as downloaded. Never had any of these problems getting it to run on windows so I'm a bit lost where to start looking for a solution now.
Does anyone know what might be causing this?
Upvotes: 0
Views: 220
Reputation: 151220
Much the same as with other languages such as python or ruby, using system perl is a bad idea and will cause you headaches down the track. What will also cause you problems (much like this one) is pulling down packages "via curl" and simply unpacking to a directory. You need to install most things properly, and there are tools to manage both of these problems.
For instance, the underlying MongoDB driver module requires a C compiler to build as part of it's install process.
You may have installed that one via apt-get
. But it is not recommended.
I would recommend using an "environment based" installation such as plenv or perlbrew in order to "manage" your installed perl installation, and not "mess around" with the system installed perl.
In either case, both will integrate well with the excellent cpanminus module and utility. This allows you to install packages from CPAN in a correct way, so that your application works and you avoid errors.
All options allow methods so you can install the modules locally for your application in this way. plenv may be better for you if you need "per application" separation on the same machine in this way.
Use the correct methods, and you are far less likely to run into problems.
Upvotes: 1