Fixes #7566 - added support for dependeces among modules

Dependences are detected from gemspec.
Support for circular deps detection included
With the new algorithm this error is obsolete.