Forum: Ruby How to handle errors thrown by Shell.rb

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Nick S. (Guest)
on 2006-01-26 00:04

I have this very simple code

require 'shell'
shell =
shell.transact do"#{path}")

Now suppose that the variable path is no longer available on disk or you
don't have permissions to access the file. How can I capture this error
and provide a helpful message? I have already tried it with rescue
Errno::EACCES but that didn't work. Thanks.

Kind regards,

This topic is locked and can not be replied to.