Online Ruby - IDE, Editör, Derleyici, Yorumlayıcı

Ruby 3.3'ü resmi ruby.wasm sürümüyle, standart kütüphane dahil tarayıcınızda çalıştırın. Çalışma ortamı bir kez indirilir ve önbelleğe alınır.

Ruby 3.3 (ruby.wasm) · Tarayıcınızda çalışır, böylece kodunuz sunucularımıza hiç ulaşmaz.
main.rbRuby
Çıktı

            
        
Çalıştırmak için Ctrl/⌘ + Enter

Online Ruby derleyicinin özellikleri (IDE, editör & yorumlayıcı)

Ruby kodunu online ve ücretsiz olarak yazın, çalıştırın ve test edin. Bu sayfa online Ruby IDE'si, kod editörü, derleyicisi ve yorumlayıcısı olarak tek bir yerde çalışır: kodunuzu yazın, Çalıştır'a basın ve çıktıyı hemen görün. Her şey tarayıcınızda çalışır; kurulacak bir şey ya da açılacak bir hesap yoktur.

  • Kodu anında çalıştırın: Ruby 3.3 (ruby.wasm), ilk yüklemeden sonra bir saniyeden kısa sürede çıktı.
  • Kod editörü: sözdizimi vurgulama, satır numaraları, parantez eşleştirme ve otomatik parantez kapatma.
  • Anlaşılır hatalar: hata mesajları ve uyarılar, kendi bilgisayarınızda olduğu gibi çıktı panelinde görünür.
  • Tam ekran: Ctrl/⌘ + Shift + F, ayarlanabilir yazı boyutu, yan yana veya alt alta düzen ve yeniden boyutlandırılabilir paneller.
  • Otomatik kaydetme: kodunuz tarayıcınızda saklanır; tek tıkla main.rb olarak indirin veya kopyalayın.
  • Güvenle deneyin: süre sınırı ve Durdur düğmesi sonsuz döngüleri sonlandırır.
  • Gizli: Ruby çalışma ortamı cihazınızda çalışır, böylece kodunuz asla yüklenmez.
  • Karanlık mod ve klavye kısayolları: Ctrl/⌘ + Enter kodu çalıştırır.
  • Ücretsiz: kayıt yok, kullanım sınırı yok.

Diğer programlama dillerini öğrenin

How to use the online Ruby compiler

  1. Write or paste Ruby code into the editor. Reset example brings back the starter program.
  2. Press Run or use Ctrl + Enter (⌘ + Enter on a Mac).
  3. Output from puts, print and p appears in the Output panel. Exceptions and messages written to $stderr are highlighted as errors.
  4. Choose a time limit of 5, 15 or 60 seconds. A run that takes longer is stopped automatically, and Stop ends it at once.

The first run downloads the Ruby runtime and its standard library, about 36 MB, so it can take a little while on a slow connection. Your browser caches it, and later visits start much faster. Use Copy or main.rb to save your program.

Ruby runs in a Web Worker in your own browser. Your code is never uploaded and is not stored on our servers. The editor remembers your last program in your browser's local storage, and in no other place.

What's supported

The compiler uses Ruby 3.3 through the official ruby.wasm build, the CRuby (MRI) interpreter compiled to WebAssembly.

  • The full Ruby 3.3 language: classes, modules, mixins, blocks, procs and lambdas, pattern matching with case/in, endless methods (def name = ...), keyword arguments and refinements.
  • Core classes such as String, Array, Hash, Range, Enumerable, Enumerator, Struct and Comparable.
  • The standard library: require "json", "set", "date", "time", "securerandom", "digest" and other bundled libraries load as usual.

Limitations:

  • No gem installation. Only libraries that ship with Ruby are available, and gem install and Bundler do not work.
  • No network access and no standard input. Hard-code the test data in your script instead of reading it with gets.
  • The interpreter is reused between runs. Classes and constants you defined earlier still exist on the next run. Press Stop to start again with a clean interpreter.

Ruby quick reference

require "json"

Book = Struct.new(:title, :year)

books = [
  Book.new("Eloquent Ruby", 2011),
  Book.new("Practical Object-Oriented Design", 2012),
]

recent = books.select { |b| b.year >= 2012 }.map(&:title)
puts "Recent: #{recent.join(', ')}"

result = { status: "ok", count: books.size }
case result
in { status: "ok", count: Integer => n }
  puts "Found #{n} books"
end

puts books.map(&:to_h).to_json
TaskSyntax
Print with a newlineputs "Hello"
Inspect a valuep [1, :a, nil]
String interpolation"Total: #{sum}"
Iterate with a blockitems.each { |x| puts x }
Hash with symbol keys{ name: "Ada", age: 36 }
Safe navigationuser&.email

Tips

  • Use p instead of puts while debugging. It shows the inspected form, so you can tell nil, "" and "nil" apart.
  • Chain Enumerable methods such as map, select, group_by, tally and each_slice to transform data without manual loops.
  • If you see warning: already initialized constant, the interpreter still remembers a previous run. Press Stop, then Run again.
  • Check generated JSON with the JSON formatter, and test regular expressions with the regex tester. Its JavaScript syntax covers most everyday Ruby patterns.
Tip: Keep this tab open while you experiment. Once Ruby has loaded, each further run starts almost instantly.

Frequently asked questions

Is this real Ruby?

Yes. ruby.wasm is the official WebAssembly port of CRuby, maintained as part of the Ruby project. The language and core classes behave the same as on your computer.

Why is the first load slow?

The interpreter and its standard library are about 36 MB. The download happens once and is then served from your browser cache.

Can I use gems like Rails or Nokogiri?

No. Only the standard library is included, and gems cannot be installed in the browser. This tool is best for learning Ruby, practising algorithms and testing snippets.

Which other languages can I run?

Try the online Python compiler, or the Lua, PHP, JavaScript, TypeScript and SQL compilers, all of which also run in your browser.

Güncellendi

Panoya kopyalandı