Introduction - Ruby!
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-1990s.
Features of Ruby
- Ruby was influenced by Perl, Smalltalk, Eiffel, Ada, and Lisp.
- Ruby has an automatic memory management and dynamic type system.
- Ruby can run on multiple platforms such as the various versions of Windows, MAC OS and UNIX.
- Ruby is free of charge but requires a liscence.
- Ruby can be used to write Common Gateway Interface (CGI) scripts.
- Ruby can be embedded into HTML.
- Ruby written applications can be easily maintainable and scalable.
- Ruby can be used for the development of Internet and Intranet applications.
- Ruby supports many GUI tools such as Tcl/Tk, GTK, OpenGL.
- Ruby can easily connect to DB2, MySQL, Oracle, Sybase.
Compile Ruby program
Create a file hello_world.rb and write below code in it
#! /usr/bin/ruby
puts "Hello World !!";
To run above code first go to the directory where hello_world.rb exists, then run the command
1
2
3
ruby hello_world.rb
# output is
Hello World !!
In irb interactive command line mode you can run and test following code:
1
2
3
>> puts "Hello, world !!"
Hello, world !!
=> nil
This post is licensed under
CC BY 4.0
by the author.