Use Rails.logger instead of writing to stdout
Replace remaining non-needed double-quotes with single-quotes
Use %w for array of words
Use raise instead of fail to rethrow exceptions