The rubber gasket sealing my dishwasher has a gap through which water sometimes escapes. I tried sealing it using caulk but most of it washed away. Is there another sealant I can use? I'm considering J-B Weld, but the label on it says it's unsafe to ingest. Is there a risk of it washing onto the dishes and making us sick? When I applied the caulk, it had been sitting in our cold garage. Do I need to warm up the caulk before applying it? Is it safe to use in the dishwasher, too?
Replacement of the gasket is the best solution
The catch is that (a) replacement gaskets tend to be relatively expensive and (b) gaskets can be tough to replace. Take a look at Appliance Parts Pros or a similar site and search for your dishwasher model # to see if a replacement gasket is readily available.
A new gasket as per the other answer is by far the best solution.
However, I have had, albeit temporary, success with making a filler from silicone or bathroom joint sealer - you want one that is just slightly soft when it is cured.
I made a "dam" with masking tape and filled to match the height. Allow to cure thoroughly and make sure the surface is very clean and dry before starting.