Learning Ruby and Rails


Ruby is a dynamic, open source, object oriented and reflective programming language. Ruby is considered similar to Perl and Smalltalk programming languages. It runs on all types of platforms like Windows, Mac OS and all versions of UNIX. It is fully object oriented programming language. Everything is an object in Ruby. Each and every code has their properties and actions. Here properties refer to variables and actions refer to methods. Ruby is considered to follow the principle of POLA (principle of least astonishment). It means that the language behaves in such a way to minimize the confusion for experienced users.

Ruby Installation

for install ruby and setup your system visit - https://rubyinstaller.org/downloads/ As of JAN 18,2020 I have installed (Ruby+Devkit 2.6.X (x64) for windows) stable version and most gems support available

Creating hello ruby program

use any text editor use below code and open terminal/command propmt to run file name is helloruby.rb , helloruby is any name (you can give name what you like) and .rb is ruby extension i.e which defines its ruby file same like we use .js or .java puts “Hello Ruby”; puts in ruby is same as console.log in javascript and system.out.println in java we can also use print in ruby like print “Hello Ruby” this also works,but doesn’t add new line. above is helloe ruby program , save this file , open command prompt/terminal in working directory and write below command to run

ruby helloruby.rb

Getting Started

Clone repo.

Github Link - https://github.com/AnKiTKaMbOj18

git clone https://github.com/AnKiTKaMbOj18/LearnRubyWithExamples.git

Remove .git folder and setup a new one

rm -rf .git && git init

Now push to whatever repo you want!



The professional learning platform

Read More