'Can't install mojolicious

I ran this command to install mojolicious and I got the command below. Not sure how to solve it, please help.

~$ sudo curl -L https://cpanmin.us | perl - -M https://cpan.metacpan.org -n Mojolicious


  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  297k  100  297k    0     0  98815      0  0:00:03  0:00:03 --:--:-- 98825
!
! Can't write to /usr/local/share/perl/5.18.2 and /usr/local/bin: Installing modules to /home/foneworx/perl5
! To turn off this warning, you have to do one of the following:
!   - run me as a root or with --sudo option (to install to /usr/local/share/perl/5.18.2 and /usr/local/bin)
!   - Configure local::lib in your existing shell to set PERL_MM_OPT etc.
!   - Install local::lib by running the following commands
!
!         cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)


Solution 1:[1]

You sudo your file download (completely useless), but don't sudo Perl. Perl is the command you need to elevate to grant write permissions to the system.

The correct command-line is:

curl -L https://cpanmin.us | sudo perl - -M https://cpan.metacpan.org -n Mojolicious

Or you could just use the regular CPAN interface (I'm not familiar with cpanminus):

sudo perl -MCPAN -e 'install Mojolicious'

Solution 2:[2]

TensowFlow is a complex piece of software that isn't easy to port/package. At the moment there is a package for TensorFlow v1 only: https://www.freshports.org/science/py-tensorflow/

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 oals
Solution 2 arrowd