Zim

Running script in custom tools produces error outside of Zim-D

Asked by casper.labuschagne

I have a ruby script I am calling in Zim custom tools. Assuming the full path of the script is "/home/myname/sh/zimscript.rb" and it is entered in Zim custom tools as "/home/myname/sh/zimscript.rb %s" the script produces the following error:

Failed to run application: /home/myname/sh/zimscript.rb
/home/myname/sh/zimscript.rb "/home/myname/Notebooks/Daily/Home/TestVimZimSyntax.txt"
returned non-zero exit status 127

Now here is the actual problem. In attempting to debug the problem I am starting zim -D in debug mode and the script works every time. However running the script from zim without debugging set on, the above error condition is produced. I have tried the same with numerous external scripts in ruby, bash and python without success when Zim is not running in debug mode. However an external command such as "lxterminal -e vim %s" works without producing the above error. I have set the permissions on the script to +777 thinking it can be permission related without success.

I have used the following (preferred) shebang in the script: "#!/usr/bin/env ruby". Could it be environment related?

Running the script(s) outside of Zim works as intended.

My environment is lubuntu 14.-04 running the i3-wm desktop. Version of Zim: Zim 0.60

Question information

Language:
English Edit question
Status:
Answered
For:
Zim Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jaap Karssenberg (jaap.karssenberg) said :
#1

Can you open a bug report and attach a simple test script that produces the
error ?

Thanks,

Jaap

On Mon, Nov 3, 2014 at 4:16 PM, casper.labuschagne <
<email address hidden>> wrote:

> New question #256714 on Zim:
> https://answers.launchpad.net/zim/+question/256714
>
> I have a ruby script I am calling in Zim custom tools. Assuming the full
> path of the script is "/home/myname/sh/zimscript.rb" and it is entered in
> Zim custom tools as "/home/myname/sh/zimscript.rb %s" the script produces
> the following error:
>
> Failed to run application: /home/myname/sh/zimscript.rb
> /home/myname/sh/zimscript.rb
> "/home/myname/Notebooks/Daily/Home/TestVimZimSyntax.txt"
> returned non-zero exit status 127
>
> Now here is the actual problem. In attempting to debug the problem I am
> starting zim -D in debug mode and the script works every time. However
> running the script from zim without debugging set on, the above error
> condition is produced. I have tried the same with numerous external
> scripts in ruby, bash and python without success when Zim is not running in
> debug mode. However an external command such as "lxterminal -e vim %s"
> works without producing the above error. I have set the permissions on the
> script to +777 thinking it can be permission related without success.
>
> I have used the following (preferred) shebang in the script:
> "#!/usr/bin/env ruby". Could it be environment related?
>
> Running the script(s) outside of Zim works as intended.
>
> My environment is lubuntu 14.-04 running the i3-wm desktop. Version of
> Zim: Zim 0.60
>
> --
> You received this question notification because you are an answer
> contact for Zim.
>

Can you help with this problem?

Provide an answer of your own, or ask casper.labuschagne for more information if necessary.

To post a message you must log in.