I'm learning how to use erb (and ruby for that matter) and having a hard time replicating examples from this site where the authors demonstrate that you can remove the trailing endline by closing a block with -%> but when I do this I get a syntax error
syntax error, unexpected ';' (Syntax Error); @values.each do |val| -; _erbout.<< "\\n".freeze
Here's an example of my code that doesn't run
<% @values = ['one','two']; puts "Was assigned."%>
<% @values.each do |val| -%>
Some stuff with <%= val %>
<% end -%>
But the following runs
<% @values = ['one','two']; puts "Was assigned."%>
<% @values.each do |val| %>
Some stuff with <%= val %>
<% end %>
Final Solution
Just to add to the accepted answer, I was running erb from the command line with
erb test.cfg.erb
Reading man erb you can enable newline trimming by setting -T with the option - so
erb -T - test.cfg.erb
Is the command I was looking for.