Errno::EEXIST File Exists error when installing 'ferret' gem from local .gem file - ruby

I am trying to install the ferret ruby gem on a RHEL zlinux (s390x architecture) machine, and am trying to install a .gem file after patching it so that it will compile.
But even trying to install the pristine fetched gem, it fails as follows:
[ me#s390x ]$ sudo gem fetch ferret
Downloaded ferret-0.11.6
[ me#s390x ]$ sudo gem install -lV ferret-0.11.6.gem
Installing gem ferret-0.11.6
Using local gem /home/rubyusr/rubygems/gems/cache/ferret-0.11.6.gem
/home/rubyusr/rubygems/gems/gems/ferret-0.11.6/bin
ERROR: While executing gem ... (Errno::EEXIST)
File exists - /home/rubyusr/rubygems/gems/gems/ferret-0.11.6/bin
None of the above-mentioned directories or files related to "ferret" existed before running this command.
Also strange is that /home/rubyusr/rubygems/gems/gems/ferret-0.11.6/bin is a directory, although maybe that is a normal complaint.
A final complicating factor is when I run the gem command I am actually running a shell script that sets the environment variables for my unusual rubygems directory (I haven't had any problems so far with this set up). Here is my gem shell script:
#!/bin/bash
export GEM_HOME=/home/rubyusr/rubygems/gems
export GEM_PREFIX=/home/rubyusr/rubygems
export RUBYLIB=$GEM_PREFIX/lib:/usr/lib/ruby:/usr/lib/ruby/site_ruby:/usr/lib/site_ruby
export GEM_PATH=$GEM_HOME
OUR_GEM_COMMAND=$GEM_PREFIX/bin/gem
$OUR_GEM_COMMAND $#
EDIT:
I forgot to add that running the gem install command normally does not seem to result in this error (but ferret fails to compile), with the error:
posh.h:515:4: error: #error POSH cannot determine target CPU

There is a bug in Debian asking for adding support for arm64:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=770922
It needs adding a few lines in the file ext/posh.h to add support for that CPU:
--- a/ext/posh.h
+++ b/ext/posh.h
## -512,6 +512,11 ##
# define POSH_CPU_STRING "PA-RISC"
#endif
+#if defined __aarch64__
+# define POSH_CPU_AARCH64 1
+# define POSH_CPU_STRING "AArch64"
+#endif
+
#if !defined POSH_CPU_STRING
# error POSH cannot determine target CPU
# define POSH_CPU_STRING "Unknown" /* this is here for Doxygen's benefit */
Adding support for s390 was about adding these lines:
#if defined __s390__
# define POSH_CPU_S390 1
# define POSH_CPU_STRING "S/390"
#endif
if you know the corresponding values for S390/X, you can add them in there.

Related

Failde to compile : ocamlfind: Package `xmlm' not found

I am trying to compile an OCaml .ml file with make command via command line remote machine but it shows me this error:
+ ocamlfind ocamlc -c -package xmlm -package unix -o pms.cmo pms.ml
ocamlfind: Package `xmlm' not found
Command exited with code 2.
Hint: Recursive traversal of subdirectories was not enabled for this build,
as the working directory does not look like an ocamlbuild project (no
'_tags' or 'myocamlbuild.ml' file). If you have modules in subdirectories,
you should add the option "-r" or create an empty '_tags' file.
To enable recursive traversal for some subdirectories only, you can use the
following '_tags' file:
true: -traverse
<dir1> or <dir2>: traverse
Compilation unsuccessful after building 6 targets (5 cached) in 00:00:00.
Makefile:10 : la recette pour la cible « native » a échouée
make: *** [native] Erreur 10
I tried to export the environment with this command:
eval $(/usr/bin/opam config env --root=/path/Ocaml/opam-ocaml-4.04-strech)
But also I had this error :
# opam-version 1.2.2
# os linux
File /p/opas/src/Ocaml/opam-ocaml-4.04-strech/config does not exist
while the config file does exist in the directory
any help Please ?!!
Thank you
To make a package available via opam (assuming that opam is properly installed and configured) you need to:
install the package
activate your opam
To install a package named foo, execute the following command in your shell
opam install foo
To activate your opam installation (which enables the search paths), issue the following command
eval $(opam config env)
or, with modern opam (that is of version 2.x) just eval $(opam env)
Before doing this, you need to properly initialize your opam installation, i.e., to install the compiler (or use the system compiler) and the base packages. This is done via the opam init command that creates an opam-managed subdirectory in your home, e.g., using an (old by today's standards) OCaml version 4.04.0, you can initialize it like this
opam init --comp=4.04.0
once the initialization is finished, do not forget to activate it via eval $(opam config env) and now you can install the package.
Finally, the version of opam that you're using is outdated and long ago deprecated, thus it is not receiving updates and the repositories that this version can understand are frozen and no longer updated. You really need to update your opam to a 2.x version. Please follow the opam installation instructions to get the latest version.

Error building latest linux kernel within VirtualBox under 18.04.1-Ubuntu

I am trying to build the latest Linux kernel (GitHub) using a Oracel VM and a 18.04.1-Ubuntu image.
I installed the need packages and probably even more. Here is a part of the packages I installed:
sudo apt-get update
sudo apt-get install git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc bison flex libelf-def kernel-package
The full list can be found here.
I ran the following commands in the linux folder after cloning the repository from GitHub.
$ cp /boot/config-$(uname -r) .config
$ make menuconfig
scripts/kconfig/mconf Kconfig
.config:1118:warning: symbol value 'm' invalid for NF_CT_PROTO_GRE
.config:1923:warning: symbol value 'm' invalid for NET_DEVLINK
.config:7865:warning: symbol value 'm' invalid for ASHMEM
.config:8724:warning: symbol value 'm' invalid for ANDROID_BINDER_IPC
.config:8725:warning: symbol value 'm' invalid for ANDROID_BINDERFS
*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.
I save and exited menuconfig. And finally make leads to the following error.
$ make -j2
Makefile:608: include/config/auto.conf: No such file or directory
Makefile:660: include/config/auto.conf.cmd: No such file or directory
HOSTCC scripts/kconfig/conf.o
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf --syncconfig Kconfig
*** Error during sync of the configuration.
scripts/kconfig/Makefile:73: recipe for target 'syncconfig' failed
make[2]: *** [syncconfig] Error 1
Makefile:562: recipe for target 'syncconfig' failed
make[1]: *** [syncconfig] Error 2
Makefile:678: recipe for target 'include/config/auto.conf.cmd' failed
make: *** [include/config/auto.conf.cmd] Error 2
make: *** Deleting file 'include/config/auto.conf.cmd'
Looks like make is expecting some additional configuration files include/config/auto.conf. Does anyone have a clue for me.
Thanks!
Trying to compile kernel 5.6.3 as non-root, I ran into this exact problem.
Running the suggestion from Oandiy's comment
git clean -xdf
revealed that I had files in my source tree that were owned by root and could not be deleted. Looking in my history I found,
sudo make localmodconfig # DO NOT DO THIS
which had installed files, as root, in include/config/* and include/generated/autoconf.h.
To see if you have the same problem, run
sudo find . -uid 0
or just look at the error messages of git clean -xdf (there shouldn't be any).
After deleting all files and directories owned by root, I recovered from this deadlock with:
unset ARCH
cp .config ../config.backup # If you still have this.
git clean -xdf # No errors (this also deletes .config)
cp ../config.backup .config # Or generate a new one *).
make olddefconfig # Printed at the end: 'No change to .config'
Note that I needed to clear ARCH from my environment.
After this I went on as usual,
VERSION=5.6.3 # I have checked out tag v5.6.3 **)
FLAVOUR=lowlatlocxhci # Or whatever you want to call your kernel.
make -j8 deb-pkg LOCALVERSION=-$FLAVOUR
sudo dpkg -i ../linux-headers-$VERSION-${FLAVOUR}_$VERSION-$FLAVOUR-1_amd64.deb ../linux-image-$VERSION-${FLAVOUR}_$VERSION-${FLAVOUR}-1_amd64.deb
The last command fails to compile virtualbox kernel modules at the moment, but I don't care about those, and those errors can be ignored (as long as you don't use virtual box).
*) The .config used was prepared by booting to a kernel with everything (ie, a dist. kernel), copying its config from /boot to the source tree and running make localmodconfig after making sure all kernel modules that I needed where loaded (by running those applications that cause such modules to be loaded). And finally running make menuconfig to turn off CONFIG_DEBUG_INFO in this kernel and to turn a few things that are normally built into the kernel into modules as well (which I needed for some reason).
**) My git tree has been prepared with:
VERSION=5.6.3
FLAVOUR=lowlatlocxhci
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-$VERSION-$FLAVOUR-$VERSION-$FLAVOUR
cd linux-$VERSION-$FLAVOUR-$VERSION-$FLAVOUR
git checkout -b test_$FLAVOUR v$VERSION
# Make manual changes here, and commit as usual.

Installation of modules Perl 6 failed - No compiler available for Perl v6.c

I installed Rakudo, the Perl 6 interpreter, by:
sudo apt-get install rakudo
I am following a tutorial about installation of Perl 6 modules:
http://perl6maven.com/how-to-install-perl6-modules
And in the last step I get this error:
perl6 bootstrap.pl===SORRY!=== Error while compiling /home/daniel/test/panda/bootstrap.pl
No compiler available for Perl v6.c
at /home/daniel/test/panda/bootstrap.pl:3
------> use v6.c⏏;
Information about versions:
Ubuntu 16.04.2 LTS
This is perl6 version 2015.11 built on MoarVM version 2015.11
How do I install the lacking compiler?
Warning: This solution can be used for development, but for production it is recommended to manually compile the interpreter until the Ubuntu repository will not be updated.
Panda described in the linked tutorial is depreciated. I should use zef to install Perl modules.
My build of Perl was too old. I realized this after reading issue 380 about not working version 6.c.
The correct tutorial about installation of the newest Perl, 6.c, on Ubuntu is here:
http://linuxtot.com/installing-perl-6-on-debian-or-ubuntu/
Now my rakudo -v prints:
This is Rakudo version 2017.07-132-gabf1cfe built on MoarVM version 2017.07-318-g604da4d
implementing Perl 6.c.
And everything works great.
The below commands are extracted from a tutorial linked below:
apt-get install build-essential git libssl-dev
git clone https://github.com/tadzik/rakudobrew ~/.rakudobrew
echo 'export PATH=~/.rakudobrew/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
rakudobrew build moar
rakudobrew build zef
Now to install the perl6 module:
zef install Module::Name
If you are comfortable installing your own software from source, then try the following (update the URL for the latest Rakudo Star from https://rakudo.perl6.org/downloads/star/):
wget -O rakudo-star-2017.07.tar.gz https://rakudo.perl6.org/downloads/star/rakudo-star-2017.07.tar.gz
tar -xvf rakudo-star-2017.07.tar.gz
cd rakudo-star-2017.07
perl Configure.pl --backend=moar --gen-moar
make
make rakudo-test
make install
Then add the following paths to your $PATH (replacing /path/to with the actual path, of course):
/path/to/rakudo-star-2017.07/install/bin
/path/to/rakudo-star-2017.07/install/share/perl6/site/bin
I use a module file for this:
#%Module1.0
## Metadata ###########################################
set this_module rakudo-star
set this_version 2017.07
set this_root /path/to/$this_module/$this_module-$this_version/install
set this_docs http://rakudo.org/documentation/
#######################################################
## Module #############################################
proc ModulesHelp { } {
global this_module this_version this_root this_docs
puts stderr "$this_module $this_version"
puts stderr "****************************************************"
puts stderr " $this_docs"
puts stderr "****************************************************\n"
}
module-whatis "Set up environment for $this_module $this_version"
prepend-path PATH $this_root/bin
prepend-path PATH $this_root/share/perl6/site/bin

Can't run luarocks, tonumber is a nil value

To install luarocks, I downloaded the most recent (2.0.11) tar.gx file from here. I unpacked it, and followed the instructions.
$ ./configure
Lua interpreter found: /usr/local/bin/lua...
Lua version detected: 5.1
Looking for Lua...
lua found in $PATH: /usr/local/bin
Checking Lua includes...
lua.h found in /usr/local/include/lua.h
curl found at /usr/bin
openssl found at /opt/local/bin
Configuring for system...
Darwin
Configuring for architecture...
i386
Writing configuration...
Installation prefix: /usr/local
LuaRocks configuration directory: /usr/local/etc/luarocks
Using Lua from: /usr/local
Done. You can now run 'make' to build.
I then ran sudo make install, and finally tried installing a package but when I try to run it I get this error:
$ sudo luarocks install lpeg
/usr/local/bin/lua: /usr/local/share/lua/5.1//luarocks/cfg.lua:355: attempt to call global 'tonumber' (a nil value)
stack traceback:
/usr/local/share/lua/5.1//luarocks/cfg.lua:355: in main chunk
[C]: in function 'require'
/usr/local/share/lua/5.1//luarocks/command_line.lua:6: in main chunk
[C]: in function 'require'
/usr/local/bin/luarocks:4: in main chunk
[C]: ?
Running lua manually, tonumber works just fine as does everything else. I don't know why it's failing here.
At the top of cfg.lua you need to add
local tonumber = tonumber
before the module call. You can include tonumber in both lines of the list of similar local definitions. You can make these changes in the installed version in /usr/local/share/lua/5.1//luarocks/cfg.lua or in the source version and make install once again.
This is a bug in luarocks and will be fixed in the next release.
My modified luarocks-2.0.11/src/luarocks/cfg.lua contains:
local rawset, next, table, pairs, require, io, os, setmetatable, pcall, ipairs, package, type, assert, tonumber, _VERSION =
rawset, next, table, pairs, require, io, os, setmetatable, pcall, ipairs, package, type, assert, tonumber, _VERSION
module("luarocks.cfg")

perl module installation shared host

My shared hosting is missing two Perl modules required by Amazon SES Scripts. They are:
Digest::SHA and XML::LibXML
I downloaded Digest::SHA from here and XML::LibXML from here
Extracted, and uploaded LibXML.pm and SHA.pm to my custome directory (my_perl_lib).
I have added:
use lib "/var/chroot/home/content/09/6758009/html/my_perl_lib";
to the second line to the perl script.
I get this:
Can't locate XML/LibXML.pm in #INC (#INC contains: /var/chroot/home/content/09/6758009
/html/my_perl_lib /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5
/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-
thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8
/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at ./ses-get-stats.pl line 24.
BEGIN failed--compilation aborted at ./ses-get-stats.pl line 24.
Please advise.
Updated:
thanks, i created the directory, the error gone, but i faced another one:
Can't locate loadable object for module XML::LibXML in #INC (#INC contains: /var/chroot
/home/content/09/6758009/html/my_perl_lib .......) at /var/chroot/home/content/09/6758009
/html/my_perl_lib/XML/LibXML.pm line 153 BEGIN failed--compilation aborted at /var/chroot
/home/content/09/6758009/html/my_perl_lib/XML/LibXML.pm line 153. Compilation failed in require
at ./ses-get-stats.pl line 24. BEGIN failed--compilation aborted at ./ses-get-stats.pl line 24.
Updated:
thanks again for your reply.
here are the results:
-bash-3.2$ perl Makefile.PL INSTALL_BASE=/var/chroot/home/content/09/6758009/html/my_perl_lib
enable native perl UTF8
running xml2-config...ok (2.6.26)
looking for -lxml2... no
looking for -llibxml2... no
libxml2 not found
Try setting LIBS and INC values on the command line
Or get libxml2 from
http://xmlsoft.org/
If you install via RPMs, make sure you also install the -devel
RPMs, as this is where the headers (.h files) are.
Also, you may try to run perl Makefile.PL with the DEBUG=1 parameter
to see the exact reason why the detection of libxml2 installation
failed or why Makefile.PL was not able to compile a test program.
-bash-3.2$
It needs to be inside an "XML" directory... IE, make sure that LibXML.pm is actually in /var/chroot/home/content/09/6758009/html/my_perl_lib/XML/LibXML.pm.
Updated:
You probably need to do a full local install of the perl module, and the shared object that accompanies it. You can do this by using:
# extract sources
# cd source-directory
# perl Makefile.PL INSTALL_BASE=/var/chroot/home/content/09/6758009/html/my_perl_lib
# make
# make install
This will install everything needed into that directory. Then in the script, reference both of these paths:
use lib '/var/chroot/home/content/09/6758009/html/my_perl_lib/lib/perl5';
use lib '/var/chroot/home/content/09/6758009/html/my_perl_lib/lib/perl5/i386-linux-thread-multi/auto';
Note that you'll likely need to change the architecture of the i386-linux-thread-multi part of that line. That's where the .so file is installed.

Resources