I am using ruby on the flexible app engine. I need to connect to a generation two cloud SQL server on the same project. I have tried directly specifying the socket from within database.yml as well as connecting via localhost, and the IPv4 address for my cloud sql instance, but nothing seems to work. I have looked at all the similar threads for this question on StackOverflow but nothing worked. I would try using a service account, but I can't find a working example of this with ruby.
The closest I have been able to get is #<Mysql2::Error: Lost connection to MySQL server at 'reading initial communication packet', system error: 0>. Please advise.

