Rammus is a Ruby library which provides a high-level API to control Chrome or Chromium over the DevTools Protocol. Rammus runs headless by default, but can be configured to run full (non-headless) Chrome or Chromium.
require 'rammus'
browser = Rammus.launch
page = browser.new_page
page.goto('https://example.com').await
page.screenshot path: 'example.png'
browser.close