Apache Jena Commands not found - jena

I'm trying to set up my system (Ubuntu 16.04) with Apache Jena 3.10.0, and followed the provided instructions, but I'm unable to access any of the commands that I should have access to.
For example, sparql --version and bin/sparql --version both return:
sparql: command not found
I have downloaded and extracted the files to /home/[user]/apache-jena-3.10.0, then run:
export JENA_HOME=/home/[user]/apache-jena-3.10.0
export PATH=$PATH:$JENA_HOME/bin
The command cd $JENA_HOME successfully goes the apache-jena-3.10.0 directory.
I feel that there is a basic linux thing here that I'm missing, but I've tried a lot of things and had no luck so far. Any help would be greatly appreciated. Thanks!

The files in the download from Apache were not marked as executable. From the main apache-jena-3.10.0 directory, chmod -R 775 bin changed all files so I could run them from command line.

Related

Ghostscript installed but not found RGhost::Config::GS[:path]='/path/to/my/gs'

I've been trying for a few hours now solve this problem and I looked everywhere for a solution and I did not find one. I'm trying to run a spec test for my project and I have the following error coming up:
RuntimeError:
Ghostscript not found in your system environment (linux-gnu).
Install it and set the variable RGhost::Config::GS[:path] with the executable.
Example: RGhost::Config::GS[:path]='/path/to/my/gs' #unix-style
RGhost::Config::GS[:path]="C:\\gs\\bin\\gswin32c.exe" #windows-style
And I do try to put RGhost::Config::GS[:path]='/usr/local/bin/gs' and it returns:
bash: RGhost::Config::GS[:path]=/usr/local/bin/gs: No such file or directory
but ghostscript is installed, I did everything (make, sudo make install, etc etc) and when I run gs -v it returns:
GPL Ghostscript 9.26 (2018-11-20)
Copyright (C) 2018 Artifex Software, Inc. All rights reserved.
When I use the user interface and search for "gs" in the "Files" application, it is found in /home/marcelle/projects/ghostscript-9.26/bin/gs and I also tried:
RGhost::Config::GS[:path]='/home/marcelle/projects/ghostscript-9.26/bin/gs'
and it returns the same error:
bash: RGhost::Config::GS[:path]=/home/marcelle/projects/ghostscript-9.26/bin/gs: No such file or directory
I also tried to delete ghostscript from my notebook with autoremove and purge and installed it again using what I mentioned before (./configure, make, sudo make install), restarted the notebook, the terminal and nothing.
PS: I'm using Ubuntu 20.04.
I managed to figure out a solution. Looking for the code for the Rghost, what I saw in its spec is that the path expected was different than the path the ghostscript really is.
When I run whereis or which on my terminal, it returns:
which gs
/usr/local/bin/gs
So I was trying to point to this path. But seeing the spec test for Rghost which I found on github for Rghost, we can see that it expects /usr/bin/gs:
it 'should detect linux env properly' do
RbConfig::CONFIG.should_receive(:[]).twice.with('host_os').and_return('linux')
File.should_receive(:exists?).with('/usr/bin/gs').and_return(true)
RGhost::Config.config_platform
RGhost::Config::GS[:path].should == '/usr/bin/gs'
end
So it expects /usr/bin and not /usr/local/bin.
Then I just copied to that path and the spec ran with no problems anymore:
sudo cp /usr/local/bin/gs /usr/bin
I've no experience with Ruby at all, but I also got this error when using asciidoctor, which uses rghost for the PDF generation.
The command RGhost::Config::GS[:path]='/path/to/my/gs' mentioned in the error is not a shell command, which is why bash couldn't handle it. However, to me it wasn't immediately clear what to do with this command either. I expected an easy way to set this variable somewhere, but couldn't find it.
What worked for me was searching the rghost.rb file, which is where this variable is set and can be changed. In Windows, it was located in C:\Ruby30-x64\lib\ruby\gems\3.0.0\gems\rghost-0.9.7\lib\rghost.rb.
In this file, I added the following line, which solved the problem:
RGhost::Config::GS[:path]="C:\\Program Files\\gs\\gs9.55.0\\bin\\gswin64c.exe"
NB: the mentioned paths can be different for everyone, so make sure to use that paths that are valid for your system.

Airflow on windows 10 - Module not found errors

I'm new to data science and wanted to do a little tutorial, which requires airflow, among other things. I installed it on windows using git bash in VS Code. I tried running it but it had a problem not being able to load the sqlite3 import
command (module not found error). I figured out that if I added the directory of sqlite3.py to the path, it would run, but now it gives me a similar error: pwd module not found from daemon.py
File "C:\ProgramData\Anaconda3\lib\site-packages\daemon\daemon.py", line 18, in <module>
import pwd
ModuleNotFoundError: No module named 'pwd'
Strange to me that it can't find pwd. Obviously pwd works in both git bash and powershell natively. It seems like a basic universal command. I'd love to learn more about what's going on. I don't want to have to end up adding 100 things to path just to get this program to run. I'd love any insights anyone can provide.
PS I'm using Anaconda.
it's seems to be the side effects of Spawning new Python Daemons .
You likely can fix this by downgrading the Python-Daemon :
pip install python-daemon==2.1.2

Wkhtmltopdf in a Dokku app?

I have a NodeJS/Express Dokku container. I'm trying to use a node module which just runs the wkhtmltopdf command from shell, but it can't find wkhtmltopdf.
Anyone have any experience with this?
You need to check how wkhtmltopdf was installed in that image.
As mentioned in node-wkhtmltopdf issues 32:
The wkhtmltopdf command is executed as a shell command on non-Windows systems.
Make sure the /usr/local/bin directory is in your $PATH variable. Do this by running:
$ sh
sh-3.2$ which wkhtmltopdf # Or try:
sh-3.2$ echo $PATH
sh-3.2$ exit
(In your case, you can do a sudo docker exec -it <containerIdOrName> sh)
The same issue adds:
What I ended up doing was downloading the dmg directly from wkhtmltopdf and that seemed to do the trick.
That means you might have to create a new image from the current one, installing wkhtmltopdf that way (with the dmg package)
jsonfry what installing wkhtmltopdf as a service container means: openlabs/docker-wkhtmltopdf-aas illustrates the installation process.
I got into the same issue as you did. I didn't want to run wkhtmltopdf in another container nor did I want to change the code to use remote calls. Since downloading wkhtmltopdf using apt-get plugin may result in a package that throws errors, I have created a new plugin that should set up wkhtmltopdf in the dokku container for you.
It is licensed using MIT license so feel free to do whatever you want. Hopefully it will help somebody.
URL: https://github.com/mbriskar/dokku-wkhtmltopdf

Missing package github.com/docker/docker/autogen/dockerversion

Trying to compile Docker in Windows according to the instructions here:
How to compile Docker on Windows
and getting this error message:
cannot find package "github.com/docker/docker/autogen/dockerversion" in any of:
Tried browsing to https://github.com/docker/docker/autogen/dockerversion but getting a 404; can anyone tell me how to get this using GIT client?
I had the same issue, the author has updated the post as you have seen to include the use of GitBash. You will need to update your source to get the new 'hack' directory content used in the instructions he outlines as per below:
git clone --depth 1 https://github.com/docker/docker.git /c/gopath/src/github.com/docker/docker
cd /c/gopath/src/github.com/docker/docker
export GOPATH=/c/gopath:/c/gopath/src/github.com/docker/docker/vendor
export DOCKER_CLIENTONLY=1
chmod +x hack/make/.go-autogen && hack/make/.go-autogen
cd docker
go build
Do you have GitBash installed? All of the instructions he provides need to be run in a GitBash window not the Windows Command window now.
I have built it successfully, so if you need any more help I may be of use.

How to install Cloud Foundry CLI on Ubuntu

I am a docker newbie.
I have an ubuntu image and wanted to install Cloud Foundry CLI on it and am unable to do so.
I downloaded the binary for CF CLI from https://github.com/cloudfoundry/cli/releases and untarred it. The untar is successful but I am unable to run the CLI.
When i run the cf i get /bin/sh: ./cf: not found message.
A couple ways to do this. Edit your path. Place the following in ~/.bash_profile or ~/.bashrc.
PATH=$PATH:/path/to/directory/containingcf
Or put cf in /usr/bin/ or somewhere that is already on your path.
If cf executable in current directory just use "./cf".
In general it is better to place cf executable somewhere in your PATH.
Please make sure the cf file has executable permissions and it is suitable for your OS architecture (e.g. Boot2Docker 1.5.0 works only with "Linux 32 bit" cf binary).

Resources