To make a string that can span multiple lines, try this:
x = %q{This is a test of the multi # w w w .java 2s. c o m line capabilities} puts x
Here, the quotation marks have been replaced with %q{ and }.
You don't have to use curly brackets, though.
You can use < and >, ( and ), or simply two other delimiters of your choice, such as ! and !.
This code works in exactly the same way:
x = %q!This is a test of the multi # w w w.j a v a 2 s.c om line capabilities! puts x
If delimiter characters are present in your string, your string literal will end early.