Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using a Ruby gem called IMGKit and when I use the gem's to_img method in the console I get this error:

IMGKit::CommandFailedError: Command failed: /rubyprograms/search --format jpg -: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open3.rb:67:in `exec': Permission denied - /rubyprograms/search (Errno::EACCES)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open3.rb:67:in `popen3'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open3.rb:53:in `fork'

I have no clue what's going on.

This is the to_img method:

def to_img(format = nil)

  result = nil
  stderr_output = nil
  Open3.popen3(*command) do |stdin,stdout,stderr|
    stdin << (@source.to_s) if @source.html?
    result = stdout.gets(nil)
    result.force_encoding("ASCII-8BIT") if result.respond_to? :force_encoding
    stderr_output = stderr.readlines.join
  raise' '), stderr_output)  unless result
  return result

For some reason it seems I do not have access to this method on Mac OSX. What are some things I should do to find out what the problem is and fix it?

share|improve this question

Re-read the error message:

Command failed: /rubyprograms/search --format jpg -: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open3.rb:67:in `exec': Permission denied - /rubyprograms/search (Errno::EACCES)

The "Permission denied" error is returned from kernel.exec()Open3.popen3() when trying to execute command /rubyprograms/search. Make sure that file has execute permission (chmod +x), try running it from Terminal.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.