I strongly recommend taking a week and counting everything you eat. Most people eat less than they think. This will at least give you a baseline.
I know it sounds trivial, but getting the fundamentals to a consistent point will help smooth out the rough edges. If you need help with calories, check out calorieking.com.
Gaining is a rather simple process. When it's broken it usually comes down to missing too many workouts, not doing enough challenging work, unrealistic expectations or sub-par nutrition. Sometimes the thing holding people back from stagnating and gains is getting calories up a bit. Not too sumo level, but up slightly.
As Clint Darden says, better to eat junk than no food. Same goes with protein. If you can't afford quality sources, at least be eating something.
In a pinch, it's also better to eat healthy, high fat foods. They are calorie dense. If choosing between 2% milk and while, get the whole!
Eat more food, push yourself on every set. I really think maximizing every set will help.