http://fabiokung.com/2010/05/06/ruby-and-dependency-injection-in-a-dynamic-world/ : this is another, much less stubborn article than James Buck's article. The bottom line is that you donโt need dependency injection because ruby โโprovides many good alternatives that work just as well and which actually don't exist in the Java world.
One of these alternatives is mixins, which Java does not have, and the other is the ability to override / override anything in the language. Other features include dynamic typing, in which you can send any message to any object, and if this happens to ensure that this message is implemented, everything will work. All of these things work together to eliminate most of the DI infrastructure need. The design template as such is still valid in Ruby, and sometimes it makes sense to use it.
Another point that Alexey Petrushin talks about is that dependency injection is primarily a design pattern, and the equipment is secondary and basically eliminating the tediousness of some things in Java. In ruby, you can trivially emulate most of what spring or guice is for you in Java. Thus, the full-blown dependency injection infrastructure in Ruby is significantly redundant.
Saying this, sometimes having a DI framework is enjoyable, as it can ultimately take away some of the wiring of wiring. I cannot vouch for any Ruby-specific DI framework, but I know many Ruby projects that ended up being rewritten in another language (even Java), because the nature of the playdo-style game makes it difficult to maintain / extend. I suspect this has a lot in common with developers shooting in the foot with various powerful language features. Having a DI framework imposes a bit of structure and idioms that can help prevent this.
Jilles van Gurp Oct 31 2018-12-12T00: 00Z
source share