Online Ruby compiler

This runs your Ruby on real CRuby 3.4, inside your browser. Your code never leaves this tab.

main.rbCRuby 3.4 (wasm)

Press Run. The CRuby 3.4 engine (about 6 MB) downloads once on your first run, then stays cached.

Ruby · runs in your browser · nothing uploadedLn 1, Col 1

// Free tool

This runs your Ruby on real CRuby 3.4, inside your browser - the reference interpreter compiled to WebAssembly, not a hosted sandbox. Blocks, Enumerable, hashes, Struct and pattern matching behave exactly as they do locally.

Nothing you type is sent to a server. Your code is saved only in this browser, the engine is downloaded once and cached, and once it has loaded the page keeps running your code with the network off. No account, no sign-in, no limit on how many times you press Run.

// What you get

CRuby 3.4 (wasm), in a browser tab

CRuby itself - the reference Ruby interpreter - compiled to WebAssembly. Not a subset and not a translation into JavaScript.

What it supports

  • Ruby 3.4: blocks, procs and lambdas, Enumerable, hashes, Struct, pattern matching and endless methods.
  • Standard input through gets, $stdin.read and each_line, from the Input box.
  • Errors printed the way ruby prints them, with the line in main.rb they came from.

What it does not

  • No gems and no network: only what is built into the interpreter can be required.
  • Nothing runs in parallel and nothing can be written to a file: the sandbox has one thread and a read-only filesystem.
  • A program is stopped after 10 seconds, and the first run downloads about 6 MB.

// Why it runs here

Your code never leaves the tab

Most online compilers send your code to a server, run it in a container, and send the output back. That means a queue when the site is busy, a hard cap on how long your program may run, and a copy of your code on someone else's disk. This one downloads the compiler instead, once, and runs everything locally from then on.

No upload, no account

  • The compiler is fetched once and cached; your source is never sent anywhere.
  • Nothing is stored on our side. Your code is kept in this browser only, so it is still here when you come back.
  • Once the engine has loaded, it keeps running with the network off, which a hosted sandbox cannot do.

Then practice it for real

  • A runner tells you what your code printed. It cannot tell you whether you have learned anything.
  • Prepshotz runs the same engines against real test cases and grades the result.
  • Practice Ruby with graded problems →

// Questions

Ruby in the browser - FAQ

01Is this real Ruby?

Yes. It is CRuby 3.4 - the interpreter your own ruby command is - compiled to WebAssembly. It is not a Ruby-to-JavaScript translation, so error messages and edge cases match what you would see locally.

02Can I install gems?

No. There is no network inside the sandbox, so only what ships inside the interpreter can be required.

03Can it read input?

Yes. Whatever you type in the Input box arrives on standard input, so gets, $stdin.read and each_line read it, and gets returns nil when it runs out.

04Does my code get uploaded anywhere?

No. The compiler runs inside your browser tab, so your code never leaves your machine. There is no server to send it to and nothing is logged on our side. Your code is kept only in this browser, and a share link carries it inside the link itself.

05Is it really free, and do I need an account?

Yes, and no. Every tool here runs without an account, a card, or a sign-in. They are free because they cost us nothing per run: the compiler is downloaded to your browser once and your own machine does the work.

Run Ruby here. Get graded on it there.

Free while we're in beta.