I decided I would go ahead and ugrade my ImageMagick today. I did it first on an old backup of our web server to make sure it would do so without problems. No problems, worked flawlessly. So, I decided to do it on my actual web server. However, after installing, I now get an error "-bash: /usr/bin/convert: No such file or directory". What is causing it to try to look in /usr/bin for convert, instead of /usr/local/bin? Yes, copying the file to /usr/bin does "fix" the problem, but why is it behaving differently on a server that is virtually identical? Doing "which convert" returns "/usr/local/bin/convert". I'm a little less experienced with Linux than Windows, so I'm not sure how to change that. Thanks!
EDIT:
Not really super important, but doing a "which -a convert" returns both versions of the file (I did a copy, not a move). However, I would still prefer it looked in /usr/local/bin, not /usr/bin for the file (just for consistency reasons, if nothing else).
Another interesting thing, is it locates "mogrify" just fine, which is also stored in "/usr/local/bin". Strange! Also, "/usr/local/bin" is in my $PATH variable.
/usr/bin/convert: No such file or directory error - FIXED!
/usr/bin/convert: No such file or directory error - FIXED!
Last edited by CGRemakes on 2010-02-19T08:11:42-07:00, edited 1 time in total.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: -bash: /usr/bin/convert: No such file or directory error
Perhaps you had multiple versions of IM on your server. You might consider removing all versions of IM and then reinstalling the latest version.
I am not a unix expert, so perhaps one of the IM experts can clarify further.
I am not a unix expert, so perhaps one of the IM experts can clarify further.
Re: -bash: /usr/bin/convert: No such file or directory error
Yeah, that was part of the upgrade. I completely uninstalled IM, then reinstalled the new version.fmw42 wrote:Perhaps you had multiple versions of IM on your server. You might consider removing all versions of IM and then reinstalling the latest version.
I am not a unix expert, so perhaps one of the IM experts can clarify further.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: -bash: /usr/bin/convert: No such file or directory error
Did you install from binary or source? If from source was it manually or with some tool or RPM. Perhaps the tool or RPM put it wrongly in /usr/bin. If you install from binary or manually from source, it should go to the right location, /usr/local/bin.
Re: -bash: /usr/bin/convert: No such file or directory error
I did it from the source. I followed these steps (with the exception of the parts that apply to RoR):fmw42 wrote:Did you install from binary or source? If from source was it manually or with some tool or RPM. Perhaps the tool or RPM put it wrongly in /usr/bin. If you install from binary or manually from source, it should go to the right location, /usr/local/bin.
https://support.railsmachine.com/index. ... age&id=133
As I mentioned, I did it also on a previous backup of the same server. It was from a few weeks ago, but nothing other than PHP/MySQL files should be different. I haven't changed any configurations.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: -bash: /usr/bin/convert: No such file or directory error
Instructions look reasonable. Also see
http://www.imagemagick.org/download/www ... .html#unix
and
http://www.imagemagick.org/script/advan ... lation.php
http://www.imagemagick.org/download/www ... .html#unix
and
http://www.imagemagick.org/script/advan ... lation.php
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: -bash: /usr/bin/convert: No such file or directory error
If I understand you correctly:
1. Executing "$ convert" runs /usr/bin/convert.
2. "which convert" shows /usr/local/bin/convert.
If that's true, something is badly wrong (with your Unix, not Imagemagick).
1. Executing "$ convert" runs /usr/bin/convert.
2. "which convert" shows /usr/local/bin/convert.
If that's true, something is badly wrong (with your Unix, not Imagemagick).
snibgo's IM pages: im.snibgo.com
Re: -bash: /usr/bin/convert: No such file or directory error
It lists both /usr/local/bin/convert, as well as /usr/local/convert using the -a switch for which. Both files do legitimately exist. Why it defaults to look in /usr/bin, and ignores /usr/local/bin when running convert, I don't know. What is it that tells Unix/Linux to look here (other than the PATH). Both are in the path, so I'm not sure what's up.snibgo wrote:If I understand you correctly:
1. Executing "$ convert" runs /usr/bin/convert.
2. "which convert" shows /usr/local/bin/convert.
If that's true, something is badly wrong (with your Unix, not Imagemagick).
EDIT:
Nevermind, after rebooting, it's a happy camper. Should have tried it earlier, but oh well.
Re: /usr/bin/convert: No such file or directory error - FIXE
In shell scripts, when using full path for convert /usr/local/bin/convert replace with `which -a convert | head -n1` this get first location for this.
For example :
replace with :
For example :
Code: Select all
/usr/local/bin/convert $filename -resize 340x255 -background black -gravity center -extent 340x255 -format jpg -quality 85 $filename2
Code: Select all
`which -a convert | head -n1` $filename -resize 340x255 -background black -gravity center -extent 340x255 -format jpg -quality 85 $filename2