Open a Ruby file in the Playground
Open Playground from Codectionary’s navigation. On a desktop-sized layout, choose New File (+) in the Explorer and select Ruby; this creates an editable untitled.rb file. You can also open a Ruby documentation example through Edit in Playground, which places its code in a Ruby file. The editor recognises .rb files and highlights Ruby syntax. On a narrower layout, use the available file selector to switch between files already open.
You can edit, rename and compare multiple files in the Explorer. These are editor files in the current page state, not a local Ruby project on your computer. Copy work you want to keep before leaving or reloading; the Playground itself warns that code is not automatically saved.
What happens when you click Run?
The current Playground does not include a Ruby runtime. Clicking Run while a Ruby file is present refreshes the web preview and adds a warning in the Console that Ruby editing and syntax highlighting are supported but Ruby execution is unavailable. It does not evaluate puts, compile Ruby or show the greeting as Ruby output.
The Preview pane renders an HTML file with browser web code. If no HTML file exists, it shows No HTML file found. If one does exist, its HTML, CSS and browser JavaScript or TypeScript preview can update independently of the Ruby file. Seeing content in Preview is therefore not evidence that Ruby ran. The Language support panel lists Ruby as Editing only.
Where output and errors appear
The bottom Console panel shows the Ruby-unavailable warning when Run is clicked. It cannot show stdout from puts, Ruby exception messages, syntax errors or a Ruby backtrace because no Ruby code was executed. An error from a web preview or another supported runner belongs to that environment, not to your .rb file.
Ruby syntax colouring is visual assistance, not validation. A highlighted file can still contain a Ruby mistake. Run the same saved source with a local Ruby installation or in IRB to see real output and errors.
Input, gems and file operations
The Playground can hold multiple editable Ruby files, but it does not run them together or resolve require_relative between them. There is no Ruby gem installation, Bundler environment or Gemfile processing in this browser preview. require "rainbow" will not load a gem there.
The optional Program input field belongs to the Java and C++ runners, not to Ruby. Since Ruby does not execute, gets cannot read input and Ruby file APIs cannot read or write files. The editable files in the Explorer are not a Ruby filesystem exposed to File.read or File.write. The HTML preview uses a browser sandbox; it is not a disguised Ruby runtime.
Run the example with a real Ruby installation
Save the line below as hello.rb on your computer after installing Ruby. Open a terminal in the file’s folder and run ruby hello.rb. Ruby executes the source and prints Hello, Codectionary! in that terminal. If the source has an error, the local Ruby process reports it there. This is a different workflow from pressing Run in Codectionary’s Playground.
For quick experiments without creating a file, start IRB with irb and enter a Ruby expression. The official TryRuby environment is another learning option, but it is separate from Codectionary and has its own capabilities. Use the local installation guides when you need gems, real files, user input or an application you can keep.
hello.rb — save locally
puts "Hello, Codectionary!"Terminal — run a local Ruby file
ruby hello.rbChoose the right environment
Use Codectionary’s Playground to read or edit Ruby snippets alongside documentation. Use IRB to evaluate short expressions with immediate feedback. Use a local Ruby installation for saved programs, input, gems, files and reliable debugging. If Codectionary adds Ruby execution later, its Language support panel and this guide should be reviewed together.
Syntax
puts "Hello, Codectionary!"Examples
A greeting to run locally
You can edit this in Codectionary, but run it with ruby hello.rb on your computer to see its output.
puts "Hello, Codectionary!"- The Playground recognises and highlights the .rb source but has no Ruby execution path.
- A local ruby hello.rb command starts a real Ruby runtime and evaluates puts.
- Only that local run prints Hello, Codectionary! or reports a Ruby error in the terminal; Playground Run shows an editing-only warning.
Best practices
- Treat Playground Ruby as editable source, not a successful test run.
- Copy important edits before leaving the page.
- Use local Ruby or IRB to verify output, errors, input, gems and file behaviour.
Runtime & versions
Ruby interpreter. Feature availability depends on the language and runtime version used by your project; consult the official reference below.
Ruby documentation