# Rails & ImageMagick CLI Backticks

**URL:** <https://www.ruby-forum.com/t/rails-imagemagick-cli-backticks/190084>\
**Category:** Rails\
**Created:** [June 14, 2010, 10:13am UTC](https://www.ruby-forum.com/t/rails-imagemagick-cli-backticks/190084 "2010-06-14T10:13:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![S-gw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ed655f/32.png) [@S-gw](https://www.ruby-forum.com/u/S-gw)\
**Post date:** [June 14, 2010, 10:13am UTC](https://www.ruby-forum.com/t/rails-imagemagick-cli-backticks/190084/1 "2010-06-14T10:13:07Z")

</div>

Rails 2.3.2, OSX 10.5.8, Ruby 1.8.6 (p369), IM 6.5.0

I have my own class to run IM commands via classic Ruby CLI backticks.  
Works perfect on my dev system in both dev and prod modes.

On my server, I can’t get any IM command to run from inside Rails. Works  
great from a plain Ruby file though.

So, something like this:

result = `/usr/local/ImageMagick/bin/convert --version`

Works fine from inside Rails on my dev system.  
Does not work\* from inside Rails on my server.

Works fine from inside a Ruby test.rb file on my dev system.  
Works fine from inside a Ruby test.rb file on my server.

So, it seems to me IM itself is installed fine on the server.

AFAICT my server is setup exactly the same as my dev system – same  
versions listed above – yet something has to be different. I’ve also  
checked permissions to the IM bin apps and they appear to be the same on  
both systems.

- “Does not work” = total silent failure. I’ve tried all kinds of ways  
to log anything, but Rails seems to think everything is fine. There’s no  
errors to log. There’s nothing to rescue, etc.

I’ve started to chase my tail, and need some new ideas for what to look  
at.

Ideas? Thx.

– gw

---

<div class="post-metadata">

**Author:** ![S-gw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ed655f/32.png) [@S-gw](https://www.ruby-forum.com/u/S-gw)\
**Post date:** [June 17, 2010, 4:22pm UTC](https://www.ruby-forum.com/t/rails-imagemagick-cli-backticks/190084/2 "2010-06-17T16:22:09Z")

</div>

On your server, try capturing stderr to see if that gives you any info  
that might help (maybe PATH issue?):

$ ./script/console production

> > puts `convert --version 2>&1`  
> > …

Jeff
