What’s a reasonable way to read an entire text file as a single string? March 23, 2023 by Tarik IO.read() is what you’re looking for. File is a subclass of IO, so you may as well just use: text = File.read(path) Can’t get more intuitive than that.