Re: "Circular require considered harmful"

Dmitriy Non <[email protected]>
Newsgroups gmane.comp.lang.ruby.general
Message-ID <[email protected]>
Hello there.

Andy Jones is right. This happens when two files require each other,
which does not make any sense really.

This is pretty common mistake (I think) and is a signal that your code is too
coupled.

> On 21 Sep 2018, at 11:48, Leam Hall <[email protected]> wrote:
> 
> Trying to figure out how to resolve this error:
> 
> /usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:59: warning: /usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:59: warning: loading in progress, circular require considered harmful
> 
> This is the file it is referencing:
> 
> https://github.com/makhidkarun/ftl_chargen/blob/master/lib/ftl_chargen.rb
> 
> How do I resolve the errors? Should only some files require the ftl_chargen.rb file for loading?
> 
> Thanks!
> 
> Leam
> 
> Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>


Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.