Try setting an explicit path for rake environment.