Skip to main content

Ruby

Ruby is a dynamic, open-source programming language focused on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write. Ruby is widely used for web development, scripting, automation, and prototyping, with its most famous framework being Ruby on Rails.


🌟 Key Concepts

  • Object-Oriented: Everything in Ruby is an object, including primitive data types.
  • Dynamic Typing: Types are determined at runtime, allowing for flexible and expressive code.
  • Garbage Collection: Automatic memory management.
  • Readable Syntax: Designed to be intuitive and close to natural language.
  • Metaprogramming: Ruby allows code to modify itself at runtime.

📚 Books & Documentation



🛠️ Common Commands

ruby -v                   # Show Ruby version
irb # Start interactive Ruby shell
gem install <gem> # Install a Ruby gem (library)
gem list # List installed gems
ruby script.rb # Run a Ruby script
bundle install # Install dependencies from Gemfile
rails new myapp # Create a new Rails app (if Rails installed)

📝 Notes

  • Ruby is especially popular for rapid web development with Ruby on Rails.
  • Gems are Ruby’s package management system for sharing libraries and tools.
  • Ruby’s community is known for being friendly and helpful.