Unable to locate XML/Simple.pm in windows - windows

I have strawberry perl installed in my C drive in windows and running
a build from an existing big project. During the build there are some
perl build scripts that needs to be executed and in the it throws the
below error message:
Below are the results of the commands I gave for verifying the existence of XML::Simple
I am wondering about the path /usr/local/lib in windows and perl is
installed in C:\Strawberry\perl\bin and XML::Simple is in
C:\Strawberry\perl\vendor\lib\XML and C:\Strawberry\perl\lib\XML.
EDIT: Output from perl -V. I have kept only for #INC
Built under MSWin32 Compiled at Aug 2 2020 19:51:20 #INC:
C:/Strawberry/perl/site/lib
C:/Strawberry/perl/vendor/lib
C:/Strawberry/perl/lib

It looks like the two situations are using different perl binaries with different library paths. When you run perl or cpan, you are using Strawberry Perl. Whatever you are doing at the top is likely using a different perl, perhaps from cygwin.
You need to install modules with the perl that wants to use them. Find the cpan for that perl (perhaps look in the Makefile to see how its finding perl, and cpan should be in the same directory).
Update your answer with the (text) output of perl -V. At the end of that output it will show the #INC directories. I'm guessing that list doesn't match the top image.

Related

bootstrap cpan without make

I want to use the cpan tool get a library from CPAN (HTTP::Tiny::Multipart). (Or should I be using something else??) It is written in pure Perl so I hope I don't need make for this. Can this be done?
At first I couldn't get things to download at all, but eventually I found out the issue was proxies, and now with the right environment variables set I can successfully reach CPAN. But now I get error messages about a missing make.
There are three common installers for Perl module distributions. To use these installers, one follows one of the following two sequences of steps:
perl Makefile.PL # ExtUtils::MakeMaker or compatible
make
make test
make install
or
perl Build.PL # Module::Build or compatible
./Build
./Build test
./Build install
cpan handles downloading the distributions and installing prerequisites, but it doesn't replace the distribution's installer. When it comes time to install a download distribution, it uses one of the above sequence (depending on whether the distribution includes a file named Build.PL or not).
HTTP-Tiny-Multipart (the distribution that provides HTTP::Tiny::Multipart) uses ExtUtils::MakeMaker as its installer, so installing it requires make.
The underlying issue is that you are using a gutted environment. It's not the purpose of git to provide perl to you.
If you want the full unix emulation environment for which git and its perl were built[1], install Cygwin. Alternatively, you could also just as easily install a native Perl such as ActivePerl or Strawberry Perl.
Technically, git and its perl are built for MSYS, which is a subset of Cygwin.

How can I install Lib::XML on ActiveState Perl 5.20?

I am trying to install Lib::XML in my ActiveState Perl Windows machine.
perl 5, version 20, subversion 2 (v5.20.2)
I tried the following:
C:\Users\VENKATESH>ppm install XML-LibXML
ppm install failed: Can't find any package that provides XML-LibXML
C:\Users\VENKATESH>ppm install http://theoryx5.uwinnipeg.ca/ppms/XML-LibXML.ppd
ppm install failed: 500 Can't connect to theoryx5.uwinnipeg.ca:80
How do I install packages for Perl on Windows?
As others mentioned, there doesn't seem to be a pre-compiled PPM for ActiveState Perl 5.20. I contributed instructions for building XML::LibXML from source on Windows. Look for them in the README file that comes with the distribution. I haven't done it in a while, but I expect they still work. I'll reproduce them here, but you should check the distribution for updates.
These instructions assume that you already have your system set up to compile
modules that use C components.
First, get the libxml2 binaries from http://xmlsoft.org/sources/win32/
(currently also available at http://www.zlatkovic.com/pub/libxml/).
You need:
iconv-VERSION.win32.zip
libxml2-VERSION.win32.zip
zlib-VERSION.win32.zip
Download the latest version of each. (Each package will probably have a
different version.) When you extract them, you'll get directories named
iconv-VERSION.win32, libxml2-VERSION.win32, and zlib-VERSION.win32, each
containing bin, lib, and include directories.
Combine all the bin, include, and lib directories under c:\Prog\LibXML. (You
can use any directory you prefer; just adjust the instructions accordingly.)
Get the latest version of XML-LibXML from CPAN. Extract it.
Issue these commands in the XML-LibXML-VERSION directory:
perl Makefile.PL INC=-Ic:\Prog\LibXML\include LIBS=-Lc:\Prog\LibXML\lib
nmake
copy c:\Prog\LibXML\bin\*.dll blib\arch\auto\XML\LibXML
nmake test
nmake install
(Note: Some systems use dmake instead of nmake.)
By copying the libxml2 DLLs to the arch directory, you help avoid conflicts
with other programs you may have installed that use other (possibly
incompatible) versions of those DLLs.
As ikegami mentioned, XML-LibXML is available upto perl 5.16 and not later.
ppm install XML-LibXML
You can use cpan utility with ActiveState's Perl.
> cpan XML::LibXML

shell/bash script to install cpan modules automatically

I want a shell script that will find the directory where perl is installed in local system, open that perl, and install all the CPAN modules automatically.
I think cpanminus is what you are looking for.
You can install modules like this:
cpanm Dancer Dancer::Plugin::Database (etc. etc.)
It will install these modules with all dependencies.
If you are installing a module and want all of it's dependencies, just tell the cpan command the module you want and it takes care of the rest.
% cpan Some::Module
The utilities that comes with perl already know where perl is because they adjust their shebang line to be the perl that installed them. They'll get all the settings from that perl when it starts.
If you want to use some other perl, run cpan with that perl. Now all the settings come from /my/other/perl.
% /my/other/perl `which cpan` Some::Module
Additionally, you can dump the cpan settings with -J, fiddle with them, and load them for a single run of cpan:
% cpan -J > settings.dump
...adjust settings...
% cpan -j settings.dump

Is there a way to make rubyinstaller play nice with cygwin?

I was having trouble getting jekyll to work with Ruby using cygwin on Windows 7 64-bit. I had better results using rubyinstaller + devkit. It would be really nice if I could use the rubyinstaller ruby inside of cygwin.
However, I get the following message when I try to execute rake.
$ rake page name="pages/about.md"
C:\Ruby193\bin\ruby.exe: No such file or directory -- /cygdrive/c/Ruby193/bin/rake (LoadError)
Is there any way to make rubyinstaller play nice with cygwin?
I just put a few of these in my .bash_profile:
alias gem=gem.bat
alias irb=irb.bat
alias rake=rake.bat
I never have any of the problems that Luis mentions.
The problem is cygwin converting all the scripts paths into cygwin paths (/cygdrive/...).
There is no solution for that since the invoke of the script is made from bash over rake scrip which invokes native Ruby.
There are a lot of other issues that cygwin will cause, and some are covered in RubyInstaller troubleshooting page
One alternative will be invoking rake.bat directly, skipping cygwin shebang detection.
But cygwin doesn't like batch files, which forces you to do cmd.exe /C rake.bat and that is a noisy command line.
The other alternative is install something like gem-exefy (gem install gem-exefy) and generate executables for your installed gems (rake.exe).
That way you invoke rake.exe instead of letting cygwin figure it out.
Another alternative is use MSYS Bash (included in DevKit) instead of cygwin, which plays way better than cygwin one, but you will still have issues with batch files.
As you can see, mixing non-native (cygwin) with native (RubyInstaller) have a lot of side-effects.

How to install DBD::Advantage

I have tried using DBD::Advantage on both Linux and Windows with no luck. The Windows version comes with what appears to be a full fledged installer, but it leaves behind the DBD-Advantage-8.10.tar.gz. Under Linux, I had done the make && make test && make install series, but regardless I get the following error on both platforms.
install_driver(Advantage) failed: Can't locate loadable object for module
DBD::Advantage in #INC (#INC contains: /usr/local/lib/perl5 /usr/local/share/perl5
/usr/lib/perl5 /usr/share/perl5 ...... several other folders.
AdvantageDatabase 8.1
Perl version is 5.12.4 on Linux and 5.12.3 Strawberry Perl on Win2008.
From the [readme.txt] included with the install:
======
The Advantage DBI Driver is contained in the DBD-Advantage.X.XX.tar.gz file. You can extract it by running:
tar -zxvf DBD-Advantage.X.XX.tar.gz
======
On Windows you should be able to extract the file using a utility such as winrar
If you can't find the module in your #INC path, the install probably failed. I'd try to manually add the package via the perl ./Makefile.PL and see if that fails.
If the module is in the #INC path, it may just be a permissions issue.

Resources