1- Learn a new technology and you realize there is a missing feature in between 2 technologies and now you can full-fill it and make it happen: it can be a Rails gem, Node package, some library, or a service.
2- Try talking to peers and folks who you feel are smarter than you, if you can be influenced by them, they can give you a good insight on what solution is missing around you or in a specific field.
3- CHECKOUT PG's essay on coming up with startup ideas: http://paulgraham.com/startupideas.html
4- DON'T push it, don't focus on coming up with an idea just for the sake of doing something. Once you let that go, some ideas will come to you.
5- Go to communities like /rails or /webdev or just go on Github and do a random search and see what people have built and left it alone, maybe you can fork something then rebuilt it or go on top of it.
6- I personally endurance through books, tweets, blogs, hackersnews, reddit, quora, github, my client startups every f#$kin content I can find when I get excited and want to build something :)! So I'm not sure if that is the smartest way to do it all the time.