Just some quick background, I did some coding-challenge for a junior ruby position while I’m happy with the results. Digging in other people ruby code I notice very few people uses the require_relative and only using require for requiring modules.
To avoid that you would need your $LOAD_PATH global variable to include the path were those files are. Usually bundler takes care of that adding the lib folder of a gem to the $LOAD_PATH but I think you can just add new paths to that variable when needed.
If the file name you pass starts with ./ or ../ then require will treat it like a relative path based on the current working directory.
Otherwise like @arielj said you will have to make sure the directory containing the file you want to load is in the load path. There’s a lot of ways to accomplish this. Bundler is one. Zeitwerk is another. You could also just manually push directories onto the $LOAD_PATH global variable. That’s what people did before Zeitwerk and Bundler came around.
Taking a look at your code, if you want to change the require_relative statements to require without relative paths, you will need to get your lib/ directory into the load path, using one of the tools I described.