# File lib/nanoc/cli/error_handler.rb, line 163
    def write_verbose_error(error, stream)
      # Date and time
      stream.puts "Crashlog created at #{Time.now}"
      stream.puts

      # Exception and resolution (if any)
      stream.puts '=== MESSAGE:'
      stream.puts
      stream.puts "#{error.class}: #{error.message}"
      resolution = self.resolution_for(error)
      stream.puts "#{resolution}" if resolution
      stream.puts

      # Compilation stack
      stream.puts '=== COMPILATION STACK:'
      stream.puts
      if self.stack.empty?
        stream.puts "  (empty)"
      else
        self.stack.reverse.each do |obj|
          if obj.is_a?(Nanoc::ItemRep)
            stream.puts "  - [item]   #{obj.item.identifier} (rep #{obj.name})"
          else # layout
            stream.puts "  - [layout] #{obj.identifier}"
          end
        end
      end
      stream.puts

      # Backtrace
      stream.puts '=== BACKTRACE:'
      stream.puts
      stream.puts error.backtrace.to_enum(:each_with_index).map { |item, index| "  #{index}. #{item}" }.join("\n")
      stream.puts

      # Version information
      stream.puts '=== VERSION INFORMATION:'
      stream.puts
      stream.puts Nanoc.version_information
      stream.puts

      # Installed gems
      stream.puts '=== INSTALLED GEMS:'
      stream.puts
      self.gems_and_versions.each do |g|
        stream.puts "  #{g.first} #{g.last.join(', ')}"
      end
      stream.puts

      # Environment
      stream.puts '=== ENVIRONMENT:'
      stream.puts
      ENV.sort.each do |e|
        stream.puts "#{e.first} => #{e.last.inspect}"
      end
      stream.puts

      # Gemfile
      if File.exist?('Gemfile.lock')
        stream.puts '=== GEMFILE.LOCK:'
        stream.puts
        stream.puts File.read('Gemfile.lock')
        stream.puts
      end

      # Load paths
      stream.puts '=== $LOAD_PATH:'
      stream.puts
      $LOAD_PATH.each_with_index do |i, index|
        stream.puts "  #{index}. #{i}"
      end
    end