I'm trying to eat the blank line.  strip_heredoc and chomp in combination would do the same thing.

I will note that the current code is a bizarre mix of styles, the most head-scratching of which (to me) is the following sequence:

        if options[:skip_javascript]
          gemfile += <<-GEMFILE.gsub(/^ {12}/, '')
            #{coffee_gemfile_entry}
            #{javascript_runtime_gemfile_entry}
          GEMFILE
        end

        gemfile.strip_heredoc.gsub(/^[ \t]*$/, '')

Note that it optionally adds to the string, stripping spaces.  Then it calls strip_heredoc which will be useless as some of the lines have no spaces.  Then it calls gsub to get rid of any other spaces.