Standard Library Reference, Functions & Ready-to-Run Code Examples
Part of The Direct Path to Linux Ubuntu
— free for all students and developers.
Ruby reads like natural English. The principle of least surprise makes it one of the fastest languages to learn and enjoy writing.
Ruby on Rails powers Shopify, GitHub, and Airbnb. A single developer can build a complete web application in hours.
Ruby's reflection and dynamic dispatch allow DSLs and code that writes code — uniquely powerful for building frameworks.
RubyGems hosts 170,000+ libraries. Install any library with gem install name or Bundler.
Run a Ruby program:
ruby script.rb # run Ruby script directly ruby -e 'puts "Hello"' # one-liner execution ruby -c script.rb # syntax check without running bundle exec ruby script.rb # run with Bundler gems irb # interactive Ruby REPL gem install rails # install a gem bundle install # install all Gemfile gems rubocop script.rb # lint and style check