LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   sh: line 1: gs: command not found (https://www.linuxquestions.org/questions/linux-software-2/sh-line-1-gs-command-not-found-317017/)

notooth 04-25-2005 01:45 PM

sh: line 1: gs: command not found
 
I got this error: "sh: line 1: gs: command not found" when running command "convert" of ImageMagick. Does anyone know how to resolve this issue?

ahwkong 04-25-2005 01:50 PM

you are not running convert of ImageMagick because it is a binary file.

Use 'convert -version' and it'd produce:
Code:

Version: ImageMagick 6.2.0 03/17/05 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2005 ImageMagick Studio LLC


Try 'convert -version' in your PC. It'd prove if you are running something else. (But you may see the same sh error again...)

Or you can open and read that 'convert' file to find out what it is.

notooth 04-26-2005 12:28 AM

I am running convert of ImageMagick because the execution of "convert -version" returns with:
Version: @(#)ImageMagick 5.3.8 09/01/01 Q:16 http://www.imagemagick.org
Copyright: Copyright (C) 2001 ImageMagick Studio

ahwkong 04-26-2005 12:32 AM

Interesting. because the error message is usually given out by a shell script.

Since your version of ImageMagick is rather old, do you think you can upgrade first and then try again...

almostlucky 04-26-2005 12:40 AM

Do you have gs (Ghostscript) installed?

notooth 04-26-2005 03:35 AM

I don't have gs installed on my machine. Where can I get it? Is it a dependency of Imagemagick?

almostlucky 04-26-2005 10:58 AM

What distro are you using? Its likely that your distro already has this packaged for you. Other wise google ghostscript, its the first link i believe.

notooth 04-26-2005 12:28 PM

I have just installed ghostscript, and it comes with the new error:

gs: error while loading shared libraries: libpng.so.2: cannot open shared object file: No such file or directory

That is strange because I already have libpng installed on my machine.

almostlucky 04-26-2005 02:02 PM

Do you have libpng.so.2? try locate libpng.so.2. It should be in /usr/lib/. Also try ldconfig as root.

notooth 04-26-2005 02:34 PM

I don't see libpng.so.2 in /usr/lib. I don't see it any where on my machine.

almostlucky 04-26-2005 03:22 PM

Hmmm. I would reinstall your libpng package.

notooth 04-26-2005 05:09 PM

I have tried to re-install many versions of libpng, but I still don't see libpng.so.2. Can anyone send it to me? I would appreciate it.

notooth 04-27-2005 11:10 AM

I found libpng.so.2 in /usr/local/lib, then I copied it to /usr/lib. After that, I executed command convert, and it turn a lot of errors:

Error: /invalidfont in findfont
Operand stack:
Times-Roman-ISO Times-Roman-ISO Times-Roman Font Times-Roman 221098 Times-Roman --nostringval-- Times-Roman NimbusRomNo9L-Regu Courier NimbusMonL-Regu
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- 3 3 %oparray_pop 4 3 %oparray_pop --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 7 4 %oparray_pop --nostringval-- --nostringval-- --nostringval-- 1 -1 1 --nostringval-- %for_neg_int_continue
Dictionary stack:
--dict:1126/1686(ro)(G)-- --dict:0/20(G)-- --dict:72/200(L)-- --dict:17/17(ro)(G)-- --dict:1126/1686(ro)(G)--
Current allocation mode is local
Last OS error: 2
Current file position is 263
AFPL Ghostscript 8.51: Unrecoverable error, exit code 1
Error: /invalidfont in findfont
Operand stack:
Times-Roman-ISO Times-Roman-ISO Times-Roman Font Times-Roman 221098 Times-Roman --nostringval-- Times-Roman NimbusRomNo9L-Regu Courier NimbusMonL-Regu
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- 3 3 %oparray_pop 4 3 %oparray_pop --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 7 4 %oparray_pop --nostringval-- --nostringval-- --nostringval-- 1 -1 1 --nostringval-- %for_neg_int_continue
Dictionary stack:
--dict:1126/1686(ro)(G)-- --dict:0/20(G)-- --dict:72/200(L)-- --dict:17/17(ro)(G)-- --dict:1126/1686(ro)(G)--
Current allocation mode is local
Last OS error: 2
Current file position is 263
AFPL Ghostscript 8.51: Unrecoverable error, exit code 1
convert: no decode delegate for this image format `/tmp/magick-XXx2mftL'.
Error: /invalidfont in findfont
Operand stack:
Times-Roman-ISO Times-Roman-ISO Times-Roman Font Times-Roman 221098 Times-Roman --nostringval-- Times-Roman NimbusRomNo9L-Regu Courier NimbusMonL-Regu
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- 3 3 %oparray_pop 4 3 %oparray_pop --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 7 4 %oparray_pop --nostringval-- --nostringval-- --nostringval-- 1 -1 1 --nostringval-- %for_neg_int_continue
Dictionary stack:
--dict:1126/1686(ro)(G)-- --dict:0/20(G)-- --dict:72/200(L)-- --dict:17/17(ro)(G)-- --dict:1126/1686(ro)(G)--
Current allocation mode is local
Last OS error: 2
Current file position is 263
AFPL Ghostscript 8.51: Unrecoverable error, exit code 1
Error: /invalidfont in findfont
Operand stack:
Times-Roman-ISO Times-Roman-ISO Times-Roman Font Times-Roman 221098 Times-Roman --nostringval-- Times-Roman NimbusRomNo9L-Regu Courier NimbusMonL-Regu
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- 3 3 %oparray_pop 4 3 %oparray_pop --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 7 4 %oparray_pop --nostringval-- --nostringval-- --nostringval-- 1 -1 1 --nostringval-- %for_neg_int_continue
Dictionary stack:
--dict:1126/1686(ro)(G)-- --dict:0/20(G)-- --dict:72/200(L)-- --dict:17/17(ro)(G)-- --dict:1126/1686(ro)(G)--
Current allocation mode is local
Last OS error: 2
Current file position is 263
AFPL Ghostscript 8.51: Unrecoverable error, exit code 1
convert: no decode delegate for this image format `/tmp/magick-XXaeZjBL'.

Can anyone help me fix the problem?

ahwkong 04-27-2005 05:37 PM

You should not just copy the so file over to new location.

The proper way is to (while the file stays where it was) include the path /usr/local/lib in ld.so.conf and then run ldconfig

It is akin to register a so file

Krugger 04-27-2005 06:22 PM

You need to install the ghostscript-fonts package. As you seem to be lacking fonts.


All times are GMT -5. The time now is 02:11 AM.