fix bugs about db connection in Rakefile