Something simple I wish I learned 17 years ago
Most of the time when you are writing an if statement, you are comparing a mutable variable to something constant (i.e. variable to string, variable to integer, variable to symbol), so you can avoid the assignment-instead-of-comparison bug by writing constant == variable instead of variable == constant. This way if you forget one of the equals signs you'll get a syntax error. The key with this is you have to get in the habit of doing it and do it all the time, so that you don't have a false sense of security. So instead of:
if foo.to_str == "hi everyone!\n"
puts "hello there!"
enduse
if "hi everyone!\n" == foo.to_str
puts "hello there!"
end