Darron's comment was spot on, but rather than calling the "kill" binary, you can just use Ruby's Process.kill method with the 0 signal:
#!/usr/bin/ruby
pid = ARGV[0].to_i
begin
Process.kill(0, pid)
puts "#{pid} is running"
rescue Errno::EPERM # changed uid
puts "No permission to query #{pid}!";
rescue Errno::ESRCH
puts "#{pid} is NOT running."; # or zombied
rescue
puts "Unable to determine status for #{pid} : #{$!}"
end
[user@host user]$ ./is_running.rb 14302
14302 is running
[user@host user]$ ./is_running.rb 99999
99999 is NOT running.
[user@host user]$ ./is_running.rb 37
No permission to query 37!
[user@host user]$ sudo ./is_running.rb 37
37 is running
Reference: http://pleac.sourceforge.net/pleac_ruby/processmanagementetc.html