Ruby Source Code
RB (.rb) files contain source code in the Ruby programming language, a dynamic, interpreted language created by Yukihiro Matsumoto in 1995. Ruby emphasizes developer happiness with elegant syntax and powers the Ruby on Rails web framework.
Source code format. Conversion is not applicable.
Common questions
What is the difference between .rb and .erb files?
RB files contain pure Ruby source code. ERB (Embedded Ruby) files mix Ruby code with HTML templates using <% %> tags, commonly used for Rails views.
Can Ruby run on the JVM?
Yes. JRuby compiles Ruby code to JVM bytecode, enabling Ruby programs to use Java libraries and run on any platform with a JVM.
Is Ruby still relevant in 2026?
Yes. Ruby powers major platforms like GitHub, Shopify, and Basecamp. Ruby 3.3+ with YJIT delivers significantly improved performance, and Rails 8 continues active development.
What makes .RB special
What is an RB file?
RB files contain source code in Ruby, a dynamic, interpreted programming language designed for developer happiness. Created by Yukihiro "Matz" Matsumoto in 1995, Ruby emphasizes elegant syntax, object-oriented design, and the principle of least surprise. It powers the Ruby on Rails web framework.
Continue reading — full technical deep dive
How to open RB files
- VS Code (Windows, macOS, Linux) — With Ruby LSP extension
- RubyMine (Windows, macOS, Linux) — JetBrains Ruby IDE
- Ruby interpreter —
ruby script.rbto execute - Any text editor — Ruby files are plain text
Technical specifications
| Property | Value |
|---|---|
| Typing | Dynamic, strong |
| Paradigm | Object-oriented (everything is an object) |
| Interpreter | CRuby (MRI), JRuby, TruffleRuby |
| Package Manager | RubyGems (gem), Bundler |
| Current Version | Ruby 3.3+ |
Common use cases
- Web development: Ruby on Rails applications.
- Scripting: Automation and task scripting.
- DevOps: Chef, Puppet, Vagrant configuration.
- Prototyping: Rapid application development.
.RB compared to alternatives
| Formats | Criteria | Winner |
|---|---|---|
| .RB vs .PY | Syntax philosophy and ecosystem Ruby emphasizes expressiveness and multiple ways to accomplish tasks. Python emphasizes readability and one obvious way. Both are dynamic interpreted languages with large ecosystems. | Draw |
| .RB vs .JS | Web development versatility JavaScript runs in both browser and server (Node.js), while Ruby is server-side only. However, Ruby on Rails remains a highly productive full-stack framework. | JS wins |
| .RB vs .PHP | Web framework productivity Ruby on Rails pioneered convention-over-configuration and RESTful design patterns that PHP frameworks later adopted. Rails remains more opinionated and productive for rapid development. | RB wins |
Technical reference
- MIME Type
text/x-ruby- Developer
- Yukihiro Matsumoto
- Year Introduced
- 1995
- Open Standard
- Yes
Binary Structure
Plain text UTF-8 source code following Ruby syntax conventions. No binary headers or magic bytes. Files typically begin with optional shebang lines (#!/usr/bin/env ruby), magic comments for encoding declarations (# encoding: utf-8), require/require_relative statements, and then class/module/method definitions. Ruby files use end keywords to close blocks rather than braces.
Attack Vectors
- Arbitrary code execution if .rb files are sourced from untrusted origins and executed
- Dependency confusion attacks via malicious gems on RubyGems.org
- eval() and send() methods can execute arbitrary strings as code if user input is unsanitized
Mitigation: FileDex does not execute code files. Reference page only.