I have the class inside lib/snowflake/connection.rb folder.
inside connection.rb file is the following structure
module SnowFlake
class Connection
end
end
Zeitwerk:check is throwing me following error.
expected file lib/snow_flake/connection.rb to define constant Connection
OK, I am going to optimistically write an answer.
Assuming the error has been copied verbatim, I suspect your application has
lib/snow_flakein the autoload paths. Why? Because otherwise the error would look like (small edits)That is, the
SnowFlakenamespace would be included in the missing constant name reported in the error message.Nested root directories represent the top-level namespace. If
lib/snow_flakeis added to the autoload paths, thenlib/snow_flake/connection.rbis expected to define the top-level constantConnection, notSnowFlake::Connection.You can inspect the autoload paths by running
If my hypothesis is confirmed, please just remove
lib/snow_flakefrom the autoload paths. It is probably being added by hand somewhere inconfig/application.rb.