you need to get all of the clues, The one I messed up on was when you have to go and talk to the old man you meet on the road crying. You need to keep checking up on him to get more information
it's before the interlude with sans, wingdings, and papyrus, when you pretty much have some free time and choose to stay at home out of the three options you're given. you have to collect all of the clues up until that point
i remembered getting stuck there only because while you're hanging out with ralsei, there's two clues given in where you want to hang out next with him--it's the swan park and the dessert shop. i pretty much pick one choice then go back to the other; i'm not sure if there's a better way of doing it, but it's what i do