Introduction to Ruby

What is Ruby?

Ruby is a pure object oriented, general purpose,interpreted and server side scripting and programming language. It was created in 1993 by Yukihiro Matsumoto of Japan. Ruby was built for making programmer's work easy. Ruby has a lot of built-in function which are common in mostly all projects.

Why Ruby?

As I have told earlier that ruby has a number of features:

  1. Easy syntax
  2. Full object oriented
  3. Faster than PHP and Pthon ( slower than C, C++ and Java).
  4. Ruby on rails is most leading framework for web development.

If you are new with programming then don't worried about features discussed below. We will read them in these tutorials:

  1. Every function returns something.
  2. Classes are never closed and you can reopen them.
  3. Gems of ruby provide make it more featured.

Ruby is more than this but at this basic stage we can not discus them.

Prerequisites:

  1. Ruby installed
  2. One IDE installed

Install ruby:

On windows, installing softwares is easy. Install Ruby Installer and feel cool.

Linux and mac have already ruby installed. Use ruby -v command to check version. If you found that there is no ruby installed or want to install latest version of ruby then use these commands. Note I have ruby 2.2.2 installed. You may have new version. For latest version just check Ruby Site.

On Linux:

  1. sudo apt-get update
  2. sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
  3. cd
  4. git clone git://github.com/sstephenson/rbenv.git .rbenv
  5. echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
  6. echo 'eval "$(rbenv init -)"' >> ~/.bashrc
  7. exec $SHELL
  8. git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
  9. echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
  10. exec $SHELL
  11. git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash
  12. rbenv install 2.2.2
  13. rbenv global 2.2.2
  14. ruby -v

On mac:

  1. ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  2. brew install rbenv ruby-build
  3. # Add rbenv to bash so that it loads every time you open a terminal
  4. echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
  5. source ~/.bash_profile
  6. # Install Ruby
  7. rbenv install 2.2.2
  8. rbenv global 2.2.2
  9. ruby -v

Install IDE:

For all systems, I recommend Aptana Studio. It is free and featured.



ReactJS with Redux Online Training by Edureka

About Harish Kumar

Harish, a fullstack developer at www.lyflink.com with five year experience in full stack web and mobile development, spends most of his time on coding, reading, analysing and curiously following businesses environments. He is a non-graduate alumni from IIT Roorkee, Computer Science and frequently writes on both technical and non-technical topics.

Related Articles

PHP stands for PHP: Hypertext Preprocessor. PHP is known as a server side scripting and interpreter language for web ...
Introduction to PHP
In this tutorial, we will study about conditional statements (if else statements and switch statements). These statem...
Conditional statements in php
In this tutorial, we will study about strings and operations upon strings. Due to long length of this section, I have...
Strings in PHP (part-1)

Complete Python Bootcamp: Go from zero to hero in Python 3

Top Posts

Recent Posts

The Complete Web Developer Course - Build 25 Websites

Meet on Twitter

Subscribe

Subscribe now and get weekly updates directly in your inbox!

Any Course on Udemy in $6 (INR 455)

Development Category (English)300x250

Best Udemy Courses

PHP with Laravel for beginners - Become a Master in Laravel