What is that get actually?
In that context, it is a local variable or a method name, so it must be defined within the method it is used (if it is a local variable) or within the same/related classes (if it is a method name). If it's not defined before you call chomp on it, you will get a crash, and that is expected.
So, you must first define that get variable/method, and call chomp on it after but only if it is NOT nil.
get.chomp if get
This will ensure that the chomp is only run when there is a variable/method named get and only when it is NOT nil.
Ohh, and in case you meant on gets.chomp, well, it is gets, not get.