The only two escape sequences allowed in a single quote string are \' (for one quote) and \\ (for one backslash). If you want to use other escape sequences, such as \n (for a new line), you must use a double-quoted string.
So this will work:
file.write "objectclass: groupOfUniqueNames\n"
Although I personally would just use puts here, which already adds a new line:
file.puts 'objectclass: groupOfUniqueNames'
JΓΆrg W Mittag
source share