Get user input in Ruby!
Getting user input gets keyword is used to get the user input as a string. #!/usr/bin/ruby puts 'what is your name?' name = gets.chomp puts "How are you #{name}" String#chomp method returns st...
Getting user input gets keyword is used to get the user input as a string. #!/usr/bin/ruby puts 'what is your name?' name = gets.chomp puts "How are you #{name}" String#chomp method returns st...
puts vs print puts and print both are used to display the result of evaluating Ruby code. Major difference between these two are: puts adds a newline after executing but print does not add new lin...
Having & Group Clause Having is used to restrict the rows affected by the Group By clause as it iis similar to Where clause. Having applies to summarized group records, whereas Where appli...
What is Ruby variables? Variables are like containers used to store information for later use. Values can be stored in the form of Integer, String, Boolean, Float, Decimal, Array, Hashes, etc. Va...
Scope of Ruby variables Global Variable Global Variables can be accessed inside classes and it’s methods. Global variable are available everywhere. It is defined by prefacing the variable nam...
How to write comments on Ruby Comments in Ruby can be written in two ways: Single line comment Single line comment followed by # symbol # This is a single line comment. Multi line co...
Backup Database pg_dump is the PostgreSQL utility to backup the database. To backup a single database, run below command in command line interface as superuser. ~ sudo pg_dump -U postgres -h loca...
When you are on Windows machine You can install BitnamiRubyStack Installers or RubyInstaller. But BitnamiRubyStack always doesnot have latest ruby supported for Win. When you are dealing with Rub...
Docker for Rails: From Development to Deployment (Complete Guide) Docker simplifies building, shipping, and running applications in isolated containers. This guide covers: ✅ Running a Rails app w...
Ruby is a dynamic, open source, server-side scripting, interpreted, reflective, object-oriented, general purpose programming language. It was designed by Yukihiro Matsumato in Japan in the mid-1990...