Mojo::UserAgent installed successfully but gives while coding

30 views
Skip to first unread message

Tanya Sahni

unread,
Jun 2, 2019, 7:43:49 AM6/2/19
to Mojolicious
Hi All,

I have successfully installed the Mojo::UserAgent :


Screenshot 2019-06-02 at 7.41.47 PM.png




But when I type only this line of code"use Mojo::UserAgent" it gives following error:


Screenshot 2019-06-02 at 4.42.03 PM.png
Is it System related issue ? Would be great if anyone shed light how to check this kind of issue?
ThanksTanya

Илья Рассадин

unread,
Jun 2, 2019, 7:52:17 AM6/2/19
to mojol...@googlegroups.com
Hi!

How did you install Mojolicious exactly? With cpanm, with git or some
other way?

Do you use system perl bundled with MacOSX, or do you install your own
version with plenv/perlbrew?

See this article for details
https://www.effectiveperlprogramming.com/2015/11/apple-recommends-installing-your-own-perl/

Tanya Sahni

unread,
Jun 2, 2019, 8:50:12 AM6/2/19
to Mojolicious
Hi

This is a new information for me.. I have done installation using cpanm although now I completely confused that my program is using which perl. And I do have perlbrew folder , sorry for not being so informative about the situation I am newbie to perl. I tried various attempts to install Mojolicious and one was also adding “requires Mojolicious” in the cpanfile file.

It would be great help if you could help me know how to differentiate between the perl I am using for my code ? is it using System perl or my installed perl ? What’s the difference using cpanm or other way affects these perl?

Илья Рассадин

unread,
Jun 2, 2019, 12:00:47 PM6/2/19
to mojol...@googlegroups.com
My guess is you installed Mojolicious into perlbrew library path, but
running program with system perl.

For example, you have this shebang line (first line in script)

#!/usr/bin/perl

You need to change it to perlbrew perl. I guess, the right way to do it
is line

#!/usr/bin/env perl

Read this perlbrew article for details how and why it works
https://perlbrew.pl/Dealing-with-shebangs.html

tanya.s...@gmail.com

unread,
Jun 8, 2019, 12:11:45 PM6/8/19
to mojol...@googlegroups.com
After adding #!/use/bin/env perl I am unable to install mojolicious..

image1.jpeg

Alan Mead

unread,
Jun 8, 2019, 12:45:02 PM6/8/19
to mojol...@googlegroups.com, tanya.s...@gmail.com
First, if you added "#!/use/bin/env" that's a typo; it should be "#!/usr/..."

The screenshot shows mojo not being present in the path; not that it's not installed. What makes you think you didn't install it? I mean, I thought you'd post some information about a failed install if the install is failing?

I know nothing about Darwin, but on a unix-y system you should be able to open a shell and type /usr/bin/env . If you cannot do that, then this shebang won't work (because that's what the shebang does is execute the command). On CentOS for example, this article says you need to use /bin/env (although my CentOS 6 machine has /usr/bin/env). If you type  /usr/bin/env and it says "command not found" then this won't work. If it spits out a page or two of technical information, look for PATH. If PATH contains a perl-specific folder, then you're using that version of perl (technically, you're using the first folder containing a perl executable, scanning PATH left to right). Otherwise you're using the system perl.

And I mention all this because all you know at this point is that the version of perl you're running doesn't have mojo, so if you think you installed it using some version of perl, then you need to ensure that you're running that version. And if the install is failing, then some information about why it's failing would be needed to fix the problem.

-Alan


On 6/8/2019 11:11 AM, tanya.s...@gmail.com wrote:
After adding #!/use/bin/env perl I am unable to install mojolicious..


Sent from my iPhone

-- 
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious...@googlegroups.com.
To post to this group, send email to mojol...@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
To view this discussion on the web visit https://groups.google.com/d/msgid/mojolicious/4a616b2c-1874-282b-da3d-cf8731e8ed7c%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

    

-- 

Alan D. Mead, Ph.D.
President, Talent Algorithms Inc.

science + technology = better workers

http://www.alanmead.org

"You're an interesting species. An interesting mix. 
You're capable of such beautiful dreams, and such 
horrible nightmares. You feel so lost, so cut off, 
so alone, only you're not. See, in all our 
searching, the only thing we've found that makes 
the emptiness bearable, is each other."

-- Carl Sagan, Contact
Reply all
Reply to author
Forward
0 new messages