Questions

Ruby questions

Choose a question page, learn the concept, then test your understanding with a quiz.

How to Undo a Rails Generator: Reversing `rails generate` in Ruby on Rails

Learn how to reverse `rails generate` in Rails, remove created files, and roll back route and config changes safely.

rubyruby-on-rails-3rails-generate

How to Undo a Scaffold in Rails

Learn how to undo a scaffold in Rails using generators, migrations, and cleanup steps with practical examples for beginners.

rubyruby-on-railsscaffolding

How to Uninstall RVM on Ubuntu: Understanding Safe Tool Removal

Learn how to uninstall RVM on Ubuntu safely, remove shell changes, and understand what a version manager modifies on your system.

rubyubuntu-9.10rvm

How to Update Ruby on macOS Yosemite with Homebrew

Learn how to update Ruby on macOS Yosemite using Homebrew, set the correct PATH, and verify the newer Ruby version works.

rubyversion

How to Use a Local Gem in a Gemfile with Bundler (Ruby)

Learn how to reference a local gem in a Ruby Gemfile using Bundler, with syntax, examples, common mistakes, and practical usage.

rubyruby-on-railsruby-on-rails-3rubygems

How to Use the Conditional Operator in Ruby

Learn how Ruby's conditional operator `? :` works, when to use it, and how to write clean ternary expressions with practical examples.

rubyternary-operatorconditional-operator

How to Write Multi-Line Comments in Ruby

Learn how multi-line comments work in Ruby, including =begin/=end, line comments, common mistakes, and practical Ruby examples.

rubycommentsmultilineblock-comments

How to Write a Switch Statement in Ruby

Learn how switch-style logic works in Ruby using `case`, `when`, and `else`, with examples, common mistakes, and practical usage tips.

rubyswitch-statementconditional-statements

How to Write to a File in Ruby

Learn how to write text files in Ruby, save database results, and use Ruby file handling methods with simple examples.

rubyfile-io

Inspect and Pretty-Print Ruby Objects and Arrays in the Console

Learn how to inspect Ruby objects and arrays with inspect, p, pp, and instance variables for practical debugging in scripts and applications.

rubyprintf-debugging

Install the PostgreSQL pg Gem on Ubuntu for Ruby

Learn how to fix pg gem native extension errors on Ubuntu by installing PostgreSQL libpq development files and configuring pg_config.

rubypostgresqlpg

Iterate Through Files in a Directory in Ruby

Learn how to loop through directory entries in Ruby with Dir.each_child, Dir.foreach, absolute paths, and safe file filtering.

rubydirectoryfilesystems

Parse JSON and Save Nested Values in Ruby on Rails

Learn how to parse JSON in Ruby on Rails, access nested API response values, and safely save a shortened URL with Active Record.

rubyruby-on-railsjson

Pass Command-Line Arguments to a Ruby Script

Learn how to pass account settings to Ruby scripts with ARGV, OptionParser, and environment variables for safe, repeatable automation.

rubycommand-line

Pretty Formatting JSON Output in Ruby on Rails

Learn how to pretty format JSON in Ruby on Rails using built-in Ruby tools, with examples, pitfalls, and practical debugging use cases.

rubyruby-on-railsjsonpretty-print

Rack Middleware in Ruby: A Beginner-Friendly Explanation

Learn what Rack middleware is in Ruby, how it processes HTTP requests and responses, and how to build and use a simple middleware class.

rubyruby-on-railshttpweb-applications

Rails Collection Routes vs Member Routes Explained

Learn the difference between Rails collection and member routes, how URL parameters work, and when to use each with practical examples.

rubyruby-on-rails

Rails Database Tasks Explained: db:migrate vs db:reset vs db:schema:load

Learn the difference between Rails db:migrate, db:reset, and db:schema:load with examples, use cases, mistakes, and a practical mini project.

rubyruby-on-railsdatabaserake

Rails I18n Locale Validation Warning: enforce_available_locales Explained

Learn what Rails I18n.enforce_available_locales does, why the deprecation warning appears, and whether setting it to false is safe.

rubyruby-on-railsruby-on-rails-4deprecated

Rails Response Content-Length Warning: Meaning and Fixes

Learn why Rails 3.1 logs “Could not determine content-length,” how HTTP response bodies are framed, and how to fix custom Rack responses safely.

rubyruby-on-railswebrick

Page 5 of 9 - 162 questions