Skip to content

Ruby Playground

← Back to docs ({{ backToDocsLabel }}) main.rb
{{ formatNotice }} loading… ready
try
editor
Tab indents and Shift+Tab outdents. Press Escape, then Tab, to leave the editor.
{{ syntaxWarnings.length }} warning{{ syntaxWarnings.length > 1 ? 's' : '' }}
  • {{ w.message }}
{{ wasmProgress != null ? ('# Loading Ruby runtime (~10 MB)… ' + wasmProgress + '%') : '# Loading Ruby runtime (~10 MB)…' }}{{ rubyReady ? '# Click Run to execute your Ruby code' : '# Press Run — Ruby (a ~10 MB download) loads the first time' }}
✗ {{ syntaxErrors.length }} syntax error{{ syntaxErrors.length > 1 ? 's' : '' }} checking syntax… ✓ no syntax errors checked as you type ruby {{ wasmVersion }} · downloading ruby {{ rubyVersion || wasmVersion }} ruby {{ wasmVersion }} · loads on first run last run {{ lastRunMs }} ms Ln {{ editorCursor.line }}, Col {{ editorCursor.col }} {{ editorCursor.lines }} {{ editorCursor.lines === 1 ? 'line' : 'lines' }} {{ keys.format }} format © ruby.help