5 ms·
> Ruby just finds stuff without me having to 'import' or 'require' it. That's either bundler (which `require`s every dependency you specify unless you tell it
by psadauskas 5y ago
> Ruby just finds stuff without me having to 'import' or 'require' it.
That's either bundler (which `require`s every dependency you specify unless you tell it not to) or the Rails autoloader[1] (which goes hunting for a file that might define the constant, which also allows hot-reloading to work). Ruby itself requires you to `require` everything.
[1]: https://guides.rubyonrails.org/autoloading_and_reloading_constants.html https://guides.rubyonrails.org/autoloading_and_reloading_con...
- scelerat 5y agothanks!
- funny_falcon 5y agoRuby requires to `require` somewhere in the project, not in the the file where actual usage is.