When I execute the following command from a Ruby program run from Sublime2 (via the latter's "build" mechanism)
/usr/local/bin/convert /Users/palfvin/tmp/cover_sheet2.pdf -depth 8 /Users/palfvin/tmp/cover_sheet2.tiff
I get the following error:
convert: Postscript delegate failed `/Users/palfvin/tmp/cover_sheet2.pdf': No such file or directory @ error/pdf.c/ReadPDFImage/678.
The input file is present and this command runs fine from the terminal. I modified the Sublime2 Ruby build settings so that the PATH environment variable is the same as in the terminal. I did a convert -list configure in both environments and the output is the same.
I gather from Convert: Postscript delegate failed and prior experience that the problem has to do with ghostscript execution, but I can't for the life of me figure out what could be causing this. Thanks in advance for any help.
Update 1: In response to first answer, here are the additional environment variables when running ruby from the terminal rather than from Sublime, excluding account/password vars (all vars from Sublime were exactly the same as their terminal counterparts). Note that the information is shown as an "array" because I obtained this by taking the output ENV in both contexts, converting that to an array and subtracting one from the other.
[["GEM_HOME", "/Users/palfvin/.rvm/gems/ruby-2.0.0-p247@avlats"],
  ["GEM_PATH", "/Users/palfvin/.rvm/gems/ruby-2.0.0-p247@avlats:/Users/palfvin/.rvm/gems/ruby-2.0.0-p247@global"],
  ["IRBRC", "/Users/palfvin/.rvm/rubies/ruby-2.0.0-p247/.irbrc"],
  ["LANG", "en_US.UTF-8"],
  ["MY_RUBY_HOME", "/Users/palfvin/.rvm/rubies/ruby-2.0.0-p247"],
  ["OLDPWD", "/Users/palfvin/avlats/spec"],
  ["PWD", "/Users/palfvin/avlats"],
  ["RUBY_VERSION", "ruby-2.0.0-p247"],
  ["SHLVL", "1"],
  ["TERM", "xterm-256color"],
  ["TERM_PROGRAM", "Apple_Terminal"],
  ["TERM_PROGRAM_VERSION", "309"],
  ["TERM_SESSION_ID", "8A3CDBC4-9495-40DC-A482-3297FE0BA614"],
  ["_", "/Users/palfvin/.rvm/rubies/ruby-2.0.0-p247/bin/ruby"],
  ["rvm_bin_path", "/Users/palfvin/.rvm/bin"],
  ["rvm_path", "/Users/palfvin/.rvm"],
  ["rvm_prefix", "/Users/palfvin"],
  ["rvm_version", "1.21.3 (stable)"]]
 
     
     
    