trouble installing MozRepl - perl

I've been trying to install WWW::Mechanize::Firefox through CPAN and I am having trouble installing the dependency MozRepl. The installation goes through but the tests all fail, and when I force install it and run my perl script, I run into an error
Failed to connect to , at /Library/Perl/5.12/MozRepl/RemoteObject.pm line 467.
SO I uninstalled MozRepl and looked at the tests I get the following errors in the log:
# Failed test at t/10-plugin-repl-enter.t line 11.
Can't locate object method "repl_enter" via package "MozRepl" at t/10-plugin-repl-enter.t line 12.
...
# Failed test at t/20-plugin-json.t line 16.
Can't locate object method "json" via package "MozRepl" at t/20-plugin-json.t line 17.
# Failed test at t/19-plugin-repl-util-doc_for.t line 14.
Can't locate object method "repl_doc_for" via package "MozRepl" at t/19-plugin-repl-util-doc_for.t line 16.
# Failed test at t/18-plugin-repl-util-help_url_for.t line 14.
Can't locate object method "repl_help_url" via package "MozRepl" at t/18-plugin-repl-util-help_url_for.t line 16.
etc..
I am running on Mac OSX 10.8.4, 4 GB Ram 2.5 Ghz, Perl version 5.12. Does anybody have any idea what is causing these errors?
UPDATE:
i reinstalled mozrepl, and now I get this error when i run my script:
Failed to connect to , problem connecting to "localhost", port 4242: Connection refused at /Users/thui/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/MozRepl/Client.pm line 144

This works for me with perl 5.10 or later, latest Firefox (26 as of writing) and Mozrepl from github.
At command propmpt:
(1) Download MozRepl and build the XPI file (Firefox extension):
git clone git://github.com/bard/mozrepl
cd mozrepl
zip -r ../mozrepl.zip *
cd ..
mv mozrepl.zip mozrepl.xpi
(2) Install the extension in Firefox via about:addons [Install from file].
In Firefox:
(3) Menu->Tools->Mozrepl->Activate On Startup
(4) Menu->Tools->Mozrepl->Start
At command propmpt:
(5) which firefox
Make sure the firefox executable (or your OS's wrapper script) is in $PATH - you should get some output!
(6) cpanm WWW::Mechanize::Firefox
(7) Test it!
At this point, if CPANminus reports no errors then WWW::Mechanize::Firefox should be working. The first example from the synopsis is a good test:
#!/usr/bin/perl
use WWW::Mechanize::Firefox;
my $mech = WWW::Mechanize::Firefox->new();
$mech->get('http://google.com');
That assumes MozRepl is listening on port 4242 (check in Menu->Tools->Mozrepl->Change Port). You can also change the port from the perl side; see options for ->new().
(8) cpanm HTML::Display::Common
I found that bcat.pl from the examples required this module, but it wasn't installed as a dependency.

Related

Unable to build Perl module Net::MAC::Vendor

I am unable to build Net::MAC::Vendor on a Mac w/ High Sierra. I am relatively new to Perl but have built modules in the past. The error appears to be:
Failed fetching [https://services13.ieee.org/RST/standards-ra-web/rest/assignments/download/?registry=MA-L&format=html&text=14-10-9F] HTTP status []
message [IO::Socket::SSL 2.009+ required for TLS support] at t/fetch_oui_from_custom.t line 21.
Could not fetch data from the IEEE! at t/fetch_oui_from_custom.t line 21.
# Failed test ''Got back array reference' isa 'ARRAY''
# at t/fetch_oui_from_custom.t line 23.
# 'Got back array reference' isn't defined
# Failed test 'Fetched Apple's OUI entry'
# at t/fetch_oui_from_custom.t line 25.
# ''
# doesn't match '(?^:Apple, Inc\.)'
# Looks like you failed 2 tests of 2.
t/fetch_oui_from_custom.t .. 2/?
# Failed test 'fetch'
# at t/fetch_oui_from_custom.t line 27.
Use of uninitialized value in concatenation (.) or string at /Users/johnprokopek/.cpan/build/Net-MAC-Vendor-1.265-13/blib/lib/Net/MAC/Vendor.pm line 320.
Failed fetching [http://standards.ieee.org/cgi-bin/ouisearch?14-10-9F] HTTP status []
Can someone help, thanks
I'm also still on High Sierra (10.13.6), on an ancient-but-still-running Mac Mini mid-2010. Using the built-in /usr/bin/perl (v5.18.2), running install Net::MAC::Vendor inside the CPAN shell gave me the same error. Running force install Net::MAC::Vendor worked, in that the module was installed.
A simple perl -MNet::MAC::Vendor -e "print 'hi'" works, so it looks like Perl can at least load that library, not really sure how to test that it works for real. But, at least this will let you install it and try it.

Issues installing perl module Bio::Perl

I am having some issues installing Bio-DB-HTS (https://github.com/Ensembl/Bio-DB-HTS) requried to run a perl script from a cloned git repository.
System & Perl information
I am on Mac OSx High Sierra v.10.13.6 and using perl 5, version 18, subversion 2 (v5.18.2). I have added this information in my original question now.
Background information
When trying to perform a local installation, according to README instructions, i receive the error...
git clone https://github.com/Ensembl/Bio-DB-HTS.git
cd Bio-DB-HTS-2.10
perl INSTALL.pl
lzma.h library header not found in /usr/include
I tried to install the LZMA library but found that it actually was installed and that the lzma.h header file was simply missing from the path /usr/include. As LZMA is deprecated and replaced with XZ I installed the XZ library
brew install xz
After a quick search i found the lzma.h header in...
/usr/local/Cellar/xz/5.2.4/include/lzma.h
Main Issue
Now this is where I am not sure of how to proceed and if I have messed up something while trying to get around this. Since /usr/include has a directory with restricted access I added a line in the INSTALL.pl script to check existence for the file in both locations (which could probably disrupt something downstream in the analysis as I didn't change anything else except the if condition. However, when running the install this time i ran into a new problem.
perl INSTALL.pl
BioPerl does not seem to be installed. Please install it and try again.
On Debian/Ubuntu systems you can do this with the command:
apt-get install bioperl
On other systems use the CPAN shell:
perl -MCPAN -e 'install Bio::Perl'
And this is where my main issues reside. When trying to install Bio:Perl using cpan tests fail at various stage and I'm not sure which ones are the essential ones. The last lines from the output are
Result: FAIL
Failed 3/325 test programs. 16/19945 subtests failed.
CJFIELDS/BioPerl-1.007002.tar.gz
./Build test -- NOT OK
//hint// to see the cpan-testers results for installing this module,
try:
reports CJFIELDS/BioPerl-1.007002.tar.gz
Running Build install
make test had returned bad status, won't install without force
I reconfigured cpan to install dependancies automatically as mentioned here How do I tell CPAN to install all dependencies?.
perl -MCPAN -Mlocal::lib=~/perl5 -e 'my $c = "CPAN::HandleConfig"; $c->load(doit => 1, autoconfig => 1); $c->edit(prerequisites_policy => "follow"); $c->edit(build_requires_install_policy => "yes"); $c->commit'
And tried installing again forcing installation...
perl -f -MCPAN -e 'install Bio::Perl'
But I just get the same error
Result: FAIL
Failed 3/325 test programs. 16/19945 subtests failed.
CJFIELDS/BioPerl-1.007002.tar.gz
./Build test -- NOT OK
//hint// to see the cpan-testers results for installing this module,
try:
reports CJFIELDS/BioPerl-1.007002.tar.gz
Running Build install
make test had returned bad status, won't install without force
When I look at what modules have been installed using...
cpan -l
Bio::DB::HTS 2.11
Bio::DB::HTS::ReadIterator 2.11
Bio::DB::HTS::VCF 2.11
Bio::DB::HTS::Faidx 2.11
Bio::DB::HTS::PileupWrapper 2.11
Bio::DB::HTS::Alignment 2.11
Bio::DB::HTS::ConfigData undef
.
.
.
Bio::DB::HTS::VCF::Iterator 2.11
Bio::DB::HTS::VCF::Row 2.11
I can see that many of the ones I need from the Bio-DB-HTS package are there (assuming that they were one of the succesful installations when isntalling Bio::Perl) but now it prompts the error
Can't locate Bio/SeqFeature/Lite.pm in #INC
However, I never manage to actually get Bio:Seq nor Bio::Perl installed. I do have some perl knowledge but mostly work on python so I am feeling a bit lost of how to proceed.
Extra information
My cpan installs modules to
/usr/local/perl
And I have added the path to my environment variable
export PERL5LIB=/usr/local/perl
Edited information (failed tests & errors) as response to Shawn
#Shawn, Its a long list of errors, test failures and recommended installations. I I can post some examples of the first couple of errors. I am not really sure what to look neither.
Recommended installations
Checking prerequisites...
recommends:
* Algorithm::Munkres is not installed
* Array::Compare is not installed
* Bio::Phylo is not installed
* Convert::Binary::C is not installed
* GD is not installed
* Graph is not installed
* GraphViz is not installed
* HTML::TableExtract is not installed
* Inline::C (0.53) is installed, but we prefer to have 0.67
* PostScript::TextBlock is not installed
* SVG is not installed
* SVG::Graph is not installed
* Set::Scalar is not installed
* Sort::Naturally is not installed
* Spreadsheet::ParseExcel is not installed
* XML::DOM is not installed
* XML::DOM::XPath is not installed
* XML::Parser::PerlSAX is not installed
* XML::SAX::Writer is not installed
* XML::Twig is not installed
* YAML is not installed
Checking optional features...
EntrezGene............disabled
requires:
! Bio::ASN1::EntrezGene is not installed
MySQL Tests...........disabled
requires:
! DBD::mysql is not installed
Pg Tests..............disabled
requires:
! DBD::Pg is not installed
Here is the test summary report. I did not print the entire list of failed tests as it is extremely long. But What I cans see is that /LocalDB/SeqFeature_BDB.t is a part of the majority of the failed tests when looking at the verbose output.
Test Summary Report
-------------------
t/LocalDB/Fasta.t (Wstat: 1024 Tests: 109 Failed: 4)
Failed tests: 73, 91, 95, 101
Non-zero exit status: 4
t/LocalDB/Index/Index.t (Wstat: 20224 Tests: 36 Failed: 6)
Failed tests: 12-17
Non-zero exit status: 79
Parse errors: Bad plan. You planned 73 tests but ran 36.
t/LocalDB/Qual.t (Wstat: 1536 Tests: 56 Failed: 6)
Failed tests: 7-9, 49-50, 52
Non-zero exit status: 6
t/LocalDB/SeqFeature_BDB.t (Wstat: 0 Tests: 38 Failed: 4)
Failed tests: 17-19, 24
Parse errors: Bad plan. You planned 116 tests but ran 38.
t/Perl.t (Wstat: 512 Tests: 47 Failed: 16)
Failed tests: 28, 28, 28, 28-29, 29, 29, 29-30, 30, 30
30-31, 31, 31, 31
Non-zero exit status: 2
Parse errors: Tests out of sequence. Found (24) but expected (26)
Tests out of sequence. Found (25) but expected (27)
Tests out of sequence. Found (26) but expected (28)
Tests out of sequence. Found (26) but expected (29)
Tests out of sequence. Found (27) but expected (30)
Displayed the first 5 of 23 TAP syntax errors.
Re-run prove with the -p option to see them all.
t/RemoteDB/BioFetch.t (Wstat: 0 Tests: 83 Failed: 47)
Failed tests: 20-21, 21-22, 22-23, 23-24, 24-25, 25-26
26-27, 27-28, 28-29, 29-30, 30, 30, 30-31
31, 31, 31-32, 32, 32, 32-33, 33, 33, 33-34
34, 34, 34-35, 35, 35, 35-36, 36, 36, 36
Parse errors: Tests out of sequence. Found (4) but expected (6)
Tests out of sequence. Found (6) but expected (7)
Tests out of sequence. Found (7) but expected (8)
Tests out of sequence. Found (5) but expected (9)
Tests out of sequence. Found (6) but expected (10)
Displayed the first 5 of 79 TAP syntax errors.
Re-run prove with the -p option to see them all.
t/RemoteDB/GenBank.t (Wstat: 0 Tests: 658 Failed: 614)
Failed tests: 10-11, 11, 11-12, 12, 12-13, 13, 13-14
14, 14-15, 15, 15-16, 16, 16-17, 17, 17-18
18, 18-19, 19, 19, 19, 19, 19, 19-20, 20
20, 20, 20, 20, 20-21, 21, 21, 21, 21, 21
21-22, 22, 22, 22, 22, 22, 22-23, 23, 23
Thanks to everyone that helped out, I managed to figure it out in the end. I will explain the process here from beginning to end incase anyone else has the same issue.
The question I posted was to solve how to install Bio::Perl using CPAN as I was having issues with tests failing. Although I had some issues installing Bio-DB-HTS (which I solved before posting) and I will explain how I managed to install that as well in case anyone comes across the same issue.
It seems that Mac users tend to have an issue with the lzma.h header missing. In the case of installing Bio-DB-HTS. I had to modify a line in the Bio-DB-HTS/INSTALL.pl file that checked for the existence of the lzma.h file. See "Installing Bio-DB-HTS on Mac OSx" below for instructions.
Solving installation of Bio::Perl
Essentially I solved it by reinstalling/reconfiguring my CPAN installation. Although I believe the issue in the end was due to some environment variables that I had not set as I chose to manual sort out my CPAN directory structure, I recommend letting CPAN do this for you using the local:lib option as it will set or tell you how to set the environment variables at the end of the installation.
I had only set one of the environment variables below (PERL5LIB) which was probably the reason for my error. NOTE! that the paths you see below are specific for my system.
PATH="/Users/sjamal/perl5/bin${PATH:+:${PATH}}"; export PATH;
PERL5LIB="/Users/sjamal/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB;
PERL_LOCAL_LIB_ROOT="/Users/sjamal/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT;
PERL_MB_OPT="--install_base \"/Users/sjamal/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=/Users/sjamal/perl5"; export PERL_MM_OPT;
If you have already it configured like me but what to start from a clean slate you will need to remove the CPAN folder created on the user that you installed cpan on.
/Users/<USERNAME>/.cpan
rm -rf /Users/<USERNAME>/.cpan
Now you should be able to run the cpan command as done at the first instance and get prompted with lots of questions of how you want to set up the installation and this is where you will be able to chose 'local:lib' (if you are able to access sudo you can choose the 'sudo' option as well). I installed cpanm based on multiple recommendations and also since it prompts less question apparently and then installed Bio::Perl. Although I should mention that the installation did failed a test and refused to install so I had to run the force command for it to build Bio::Perl.
cpan -i App:cpanminus
cpanm --force Bio::Perl
You should now have Bio::Perl installed.
Installing Bio-DB-HTS on Mac OSx
The lzma library is deprecated on Mac OSx but has been replaced with the XZ library so if you are missing the file as well you can install XZ using brew. If you don't have brew installed you can find how to install it here https://brew.sh/
brew install xz
You will now have a lzma.h header file in the location where XZ was installed using brew, in my case /usr/local/Cellar/xz/5.2.4/include/lzma.h.
git clone https://github.com/Ensembl/Bio-DB-HTS.git
cd Bio-DB-HTS-2.10
vim Bio-DB-HTS/INSTALL.pl
So, I changed the line using vim...
-e '/usr/include/lzma.h' or die <<END;
to
-e '/usr/include/lzma.h' **|| '/usr/local/Cellar/xz/5.2.4/include/lzma.h'** or die <<END;
NOTE! You have to change '/usr/local/Cellar/xz/5.2.4/include/lzma.h' path to where you have the lzma.h in XZ package just installed using brew. However, I want to clarify that this does not solve anything other than telling the script that the file does exist. The Install script won't be able to make use of the file (if that is what it needs to do) as nothing else has been changed in the installation script.
You should now be able to install Bio-DB-HTS by simply running the perl script as below
cd Bio-DB-HTS-2.10
perl INSTALL.pl
Hope that helps!
Sabri

Why a Perlbrew PSGI application with uwsgi_psgi causes "wrong" Perl include paths?

I want to deploy a PSGI based web application by using an uWSGI gateway interface.
To accomplish this I installed Perlbrew locally on my Debian server where no root access is available.
perlbrew init
# close shell and reopen new shell
perlbrew self-install
# close shell and reopen new shell
perlbrew self-upgrade
# close shell and reopen new shell
perlbrew install-patchperl
perlbrew install-cpanm
# close shell and reopen new shell
perlbrew install -j 10 perl-5.26.1
perlbrew lib create perl-5.26.1#main
perlbrew switch perl-5.26.1#main
# close shell and reopen new shell
Then I checked using cpanm -V the Perl environment:
cpanm (App::cpanminus) version 1.7043 (/home/soeren/perl5/perlbrew/bin/cpanm)
perl version 5.026001 (/home/soeren/perl5/perlbrew/perls/perl-5.26.1/bin/perl)
%Config:
archname=x86_64-linux
installsitelib=/home/soeren/perl5/perlbrew/perls/perl-5.26.1/lib/site_perl/5.26.1
installsitebin=/home/soeren/perl5/perlbrew/perls/perl-5.26.1/bin
installman1dir=/home/soeren/perl5/perlbrew/perls/perl-5.26.1/man/man1
installman3dir=/home/soeren/perl5/perlbrew/perls/perl-5.26.1/man/man3
sitearchexp=/home/soeren/perl5/perlbrew/perls/perl-5.26.1/lib/site_perl/5.26.1/x86_64-linux
sitelibexp=/home/soeren/perl5/perlbrew/perls/perl-5.26.1/lib/site_perl/5.26.1
archlibexp=/home/soeren/perl5/perlbrew/perls/perl-5.26.1/lib/5.26.1/x86_64-linux
privlibexp=/home/soeren/perl5/perlbrew/perls/perl-5.26.1/lib/5.26.1
%ENV:
PERL5LIB=/home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5
PERLBREW_HOME=/home/soeren/.perlbrew
PERLBREW_LIB=main
PERLBREW_MANPATH=/home/soeren/.perlbrew/libs/perl-5.26.1#main/man:/home/soeren/perl5/perlbrew/perls/perl-5.26.1/man
PERLBREW_PATH=/home/soeren/.perlbrew/libs/perl-5.26.1#main/bin:/home/soeren/perl5/perlbrew/bin:/home/soeren/perl5/perlbrew/perls/perl-5.26.1/bin
PERLBREW_PERL=perl-5.26.1
PERLBREW_ROOT=/home/soeren/perl5/perlbrew
PERLBREW_SHELLRC_VERSION=0.82
PERLBREW_VERSION=0.82
PERL_LOCAL_LIB_ROOT=/home/soeren/.perlbrew/libs/perl-5.26.1#main
PERL_MB_OPT=--install_base /home/soeren/.perlbrew/libs/perl-5.26.1#main
PERL_MM_OPT=INSTALL_BASE=/home/soeren/.perlbrew/libs/perl-5.26.1#main
#INC:
FatPacked::93953009226544=HASH(0x557323bd9330)
/home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/x86_64-linux
/home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5
/home/soeren/perl5/perlbrew/perls/perl-5.26.1/lib/site_perl/5.26.1/x86_64-linux
/home/soeren/perl5/perlbrew/perls/perl-5.26.1/lib/site_perl/5.26.1
/home/soeren/perl5/perlbrew/perls/perl-5.26.1/lib/5.26.1/x86_64-linux
/home/soeren/perl5/perlbrew/perls/perl-5.26.1/lib/5.26.1
Everything looks good so I installed Dancer2 as the web framework of choice and successfully launched a skeleton test application:
dancer2 gen --application DemoApp
cd ./DemoApp
plackup ./bin/app.psgi
The Plack-internal HTTP web server has started and was ready to serve the application.
Again, so far so good. But I wanted to go with uWSGI instead of having yet another fully fledged web server in the service chain.
So I installed uwsgi-plugin-psgi which automatically comes with uwsgi-core:
apt install uwsgi-plugin-psgi
Now I wanted to start the uWSGI gateway interface...:
uwsgi_psgi --uwsgi-socket 127.0.0.1:5999 --psgi /home/soeren/DemoApp/bin/app.psgi
...and the application has crashed:
[uwsgi] implicit plugin requested psgi
*** Starting uWSGI 2.0.14-debian (64bit) on [Fri Feb 9 10:41:20 2018] ***
compiled with version: 6.2.1 20161124 on 07 December 2016 16:14:59
os: Linux-4.9.0-5-amd64 #1 SMP Debian 4.9.65-3+deb9u2 (2018-01-04)
nodename: skde-deu-02.sklink.de
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 8
current working directory: /home/soeren/DemoApp
detected binary path: /usr/bin/uwsgi-core
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 256817
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to TCP address 127.0.0.1:5999 fd 3
initialized Perl 5.24.1 main interpreter at 0x557337c6fd40
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 72768 bytes (71 KB) for 1 cores
*** Operational MODE: single process ***
Error while loading /home/soeren/DemoApp/bin/app.psgi: Can't locate WWW/Form/UrlEncoded.pm in #INC (you may need to install the WWW::Form::UrlEncoded module) (#INC contains: /home/soeren/DemoApp/bin/../lib /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/5.24.1/x86_64-linux-gnu-thread-multi /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/5.24.1 /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/x86_64-linux-gnu-thread-multi /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5 /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl) at /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/HTTP/Entity/Parser/UrlEncoded.pm line 5.
BEGIN failed--compilation aborted at /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/HTTP/Entity/Parser/UrlEncoded.pm line 5.
Compilation failed in require at /usr/share/perl/5.24/Module/Load.pm line 77.
Can't locate HTTP/Entity/Parser/UrlEncoded in #INC (#INC contains: /home/soeren/DemoApp/bin/../lib /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/5.24.1/x86_64-linux-gnu-thread-multi /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/5.24.1 /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/x86_64-linux-gnu-thread-multi /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5 /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl) at /usr/share/perl/5.24/Module/Load.pm line 77.
Compilation failed in require at /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/Plack/Request.pm line 17.
BEGIN failed--compilation aborted at /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/Plack/Request.pm line 17.
Compilation failed in require at /usr/share/perl/5.24/parent.pm line 16.
BEGIN failed--compilation aborted at /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/Dancer2/Core/Request.pm line 6.
Compilation failed in require at /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/Dancer2/Core/App.pm line 29.
BEGIN failed--compilation aborted at /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/Dancer2/Core/App.pm line 29.
Compilation failed in require at /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/Dancer2.pm line 11.
BEGIN failed--compilation aborted at /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/Dancer2.pm line 11.
Compilation failed in require at /home/soeren/DemoApp/bin/../lib/DemoApp.pm line 2.
BEGIN failed--compilation aborted at /home/soeren/DemoApp/bin/../lib/DemoApp.pm line 2.
Compilation failed in require at /home/soeren/DemoApp/bin/app.psgi line 10.
BEGIN failed--compilation aborted at /home/soeren/DemoApp/bin/app.psgi line 10.
unable to find PSGI function entry point.
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 9769, cores: 1)
The fist thing that I see was the architecture. While the other (cpnam and plackup) programs using "x86_64-linux" architecture, only uWSGI is using "x86_64-linux-gnu-thread-multi" instead.
Well Perl's architecture folder for "x86_64-linux-gnu-thread-multi" is available but does not contain any modules. Most modules are installed in the "root library path" and "x86_64-linux" architecture folder.
/home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5
/home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/x86_64-linux
I tried to work around this by using the uwsgi_psgi command line switch --perl-local-lib but had no luck:
uwsgi_psgi --uwsgi-socket 127.0.0.1:5999 --psgi /home/soeren/DemoApp/bin/app.psgi --perl-local-lib /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5
uwsgi_psgi --uwsgi-socket 127.0.0.1:5999 --psgi /home/soeren/DemoApp/bin/app.psgi --perl-local-lib /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/x86_64-linux
I also have messed around with different uWSGI operation modes (single process, prefork, threaded), but also no luck.
Why is uWSGI modifying the include path and how do I either start uWSGI so it works like with the other programs or install the modules for that architecture in addition?
I found a solution, thanks to #simbabque.
My issue was that I was using the system native uwsgi_psgi, which was compiled with the system Perl installation and was not compatible with my local Perlbrew installation.
This mailing list thread suggest to recompile uwsgi within the Perlbrew scope to be able to work (only) with the local Perlbrew installation.
So by doing the following compile I get managed to start the Perl application:
curl http://uwsgi.it/install | bash -s psgi /home/soeren/perl5/perlbrew/bin/uwsgi
However the above shown command is not the best way since it lacks all further important compile switches (e.g. pcre, jit).
I will improve this answer over time with the further compile switches.

Selenium headless does not run on CentOS 7 with Perl, "no display specified"

I try to run headless Selenium on CentOS7:
# cat /etc/os-release
NAME="Red Hat Enterprise Linux Server"
VERSION="7.2 (Maipo)"
I installed Xvfb and run it as
# /usr/bin/Xvfb :99
I installed firefox:
# firefox -v
Mozilla Firefox 38.5.0
and run it to check if it can be run at all:
# export DISPLAY=:99
# firefox
This is the output:
# firefox
Xlib: extension "RANDR" missing on display ":99".
console.error:
[CustomizableUI]
Custom widget with id loop-button does not return a valid node
console.error:
[CustomizableUI]
Custom widget with id loop-button does not return a valid node
GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications.
Firefox seems to be running after that command:
# ps aux | grep firefox
root 29476 7.3 14.9 852356 152256 pts/3 Sl+ 10:30 0:03 /usr/lib64/firefox/firefox
EDIT
Yes, it's running. Taking screenshot from the Xvfb by
DISPLAY=:99 import -window root -crop 1264x948+0+0 /tmp/screenshot.jpg
I can see
Now the problematic part.
I installed Selenium Remote Driver for perl
# cpanm Selenium::Remote::Driver
Then I ran standalone selenium driver:
# java -jar selenium-server-standalone-2.49.0.jar
Now I run test script:
#!/usr/bin/perl
use strict;
use warnings;
use Selenium::Remote::Driver;
my $driver = Selenium::Remote::Driver->new(browser_name=>'firefox');
$driver->get('http://www.google.com');
print $driver->get_title();
$driver->quit();
After 45 second I get error from the driver:
Could not create new session: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
Error: no display specified
at (eval 89) line 510.
Seems like firefox launched by the driver does not see DISPLAY environment variable. I try to add it from the script:
#!/usr/bin/perl
use strict;
use warnings;
use Selenium::Remote::Driver;
$ENV{DISPLAY}=":99";
my $driver = Selenium::Remote::Driver->new(browser_name=>'firefox');
$driver->get('http://www.google.com');
print $driver->get_title();
$driver->quit();
It does not help, the previous error remains.
What do I do?
EDIT2
I tried the current setup with Python. All works.
# pip install selenium
And used the following test script:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Firefox()
driver.get("http://www.python.org")
f = open('ptn-sel.txt', 'w')
f.write(driver.title)
driver.close()
f.close()
I understand it's problem of Perl driver.... Any suggestions?
Is python using the standalone server or running firefox itself?
If perl is using the server and the server is spawning firefox then you need $DISPLAY set in the server processes environment not the script's environment. (By running export DISPLAY=:99; java -jar selenium-server-standalone-2.49.0.jaror similar.)
If you don't want to use the standalone server at all then Selenium::Firefox looks like it might be interesting.

Perl module broke my windows xampp installation

PROBLEM: In the process of trying to install gitstat on a Windows7 machine I broke my xampp Apache installation. Now I can't get gitstat or apache to work.
APACHE ERROR:
[error] Can't load Perl file: C:/xampp/apache/conf/extra/startup.pl for server localhost:80, exiting...`
Other people have reported this issue being caused by the PERL5LIB environment variable, but that variable does not exist on my machine.
WHAT I DID / GITSTAT ERROR:
I needed the SOAP::Lite module installed so I followed the windows guide here: http://soaplite.com/install.html
As far as I could tell I installed the module successfully, console output below
cpan[1]> install SOAP::Lite
CPAN: Storable loaded ok (v2.21)
Going to read '\xampp\perl\bin\.cpan\Metadata'
Database was generated on Wed, 27 Jun 2012 02:47:03 GMT
SOAP::Lite is up to date (0.714).
I saw a SOAP directory in perl/site/lib which (to me) means that the module should be available. When I look in my perllocal.pod file SOAP:Lite is in there.
Part of the gitstat installation instructions say to copy the Lite.pm file from perl/site/lib/SOAP into gitstat\gstat_pl\lib
However, when I try to perform step nine of gitstat installation (perl gitstat.pl HEAD) I get the following:
C:\xampp\htdocs\gitstat\gstat_pl>perl gitstat.pl HEAD
Supported versions:
BEGIN failed--compilation aborted at C:/xampp/perl/site/lib/SOAP/Lite.pm line 34
86.
Compilation failed in require at C:/xampp/perl/site/lib/SOAP/Constants.pm line 1
3.
BEGIN failed--compilation aborted at C:/xampp/perl/site/lib/SOAP/Constants.pm li
ne 13.
Compilation failed in require at lib/Lite.pm line 3444.
BEGIN failed--compilation aborted at lib/Lite.pm line 3444.
Compilation failed in require at gitstat.pl line 30.
If I don't copy the file from perl/site/lib/SOAP then I get
C:\xampp\htdocs\gitstat\gstat_pl>perl gitstat.pl HEAD
Can't locate lib/Lite.pm in #INC (#INC contains: C:/xampp/perl/lib C:/xampp/perl
/site/lib .) at gitstat.pl line 30.
I don't understand why CPAN didn't install the Lite.pm module in the #INC path or why the compilation might fail when the module is available, or most importantly why my Apache install is broken. Also I'm very new to Perl and CPAN and my understanding of Apache is primitive so simpler explanations would be greatly appreciated.