No, you get an undefined local variable or method error message. But if you want to check if something is defined or not, you can use the defined? method defined? similar to this
if defined?(my_var) print 'defined' else print 'not defined' end
source share