read an arbitrary number of bytes from a file into a single variable using read:
File.open("text.txt") do |f| puts f.read(6) end