Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting Started With Ruby
#1
Ruby
A Programmer's Best Friend.


Firstly; What Is Ruby?


Ruby is a dynamic, reflective, general-purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features. Ruby originated in Japan during the mid-1990s and was first developed and designed by Yukihiro "Matz" Matsumoto. It was influenced primarily by Perl, Smalltalk, Eiffel, and Lisp.

Ruby supports multiple programming paradigms, including functional, object oriented, imperative and reflective. It also has a dynamic type system and automatic memory management; it is therefore similar in varying respects to Python, Perl, Lisp, Dylan, Pike, and CLU.

It appeared in 1995 and was designed by Yukihiro Matsumoto.

Ruby is also cross-platform. This means you can run it on any OS.

How Can I Get Started?


You will need to download Ruby before you do anything. You can download it here: Ruby

Next you will need to know how to run Ruby files.

Ruby file extension are usually; .rb & .rbw

After you have installed Ruby and create a test file you will need to into cmd or console and navigate to the folder that you saved the file. For example:

[Image: Untitled.png]

After you enter the file you want to run and press enter.

Try it for yourself!


Open up your favorite text editor, the one I am using is Notepad++.

Enter the following;

Code:
puts 'Hello, World!'

Then save it as hello.rb and run it! Now that wasn't so hard, compared to C++, that is a lot less code.

Code:
// THIS IS C++ NOT RUBY.
#include <iostream>
using namespace std;

int main ()
{
  cout << "Hello World!";
  return 0;
}

Isn't there an easier way to test Ruby Statements?



Alternatively you can use Interactive Ruby.

Ruby comes with a program that will show the results of any Ruby statements you feed it. Playing with Ruby code in interactive sessions like this is a terrific way to learn the language.

Open up IRB (which stands for Interactive Ruby).

If you’re using Mac OS X open up Terminal and type irb, then hit enter.
If you’re using Linux, open up a shell and type irb and hit enter.
If you’re using Windows, open fxri from the Ruby section of your Start Menu.

[Image: Untitl6ed.png]

Enter your statement: puts 'Hello, SF!' press ENTER and and it does the rest for you.

Note: I used ' instead of " but you can use whichever you want.
[Image: Untitl6ed.png]

Now What?


Now you learn Ruby!

Resources!

RubyLearning

IDE's:
Aptana
RubyMine
TextMate
NetBeans - My Favorite
Komodo IDE


Offical Site!
Ruby Blog
rubycorner Blog
Ruby Inside Blog



If you need any help; PM me or post here!
Someone with no history is nothing but suspicious.
Reply
#2
This is some good information, thank you for sharing.
I was hired to write a simple 2d game, no matter how..lol... (his words)...
Now I'm looking into ruby, python and jQuery, Ruby is the language I'll most probably use for it...
Reply
#3
good resource, makes me want to look into ruby
Reply
#4
Good share mate. Thanks for the info.
[Image: inm4jO.png]
[ AIM: YoRelapse | Gamertag: N/A | MSN: YoRelapse@live.com ]
Reply
#5
I think Im going to have to check this language out some time.
Reply
#6
If you wanna learn Ruby on Rails I also suggest this website: http://railsforzombies.org/

Nice thread though! I still suck at Ruby but I'm trying to learn.
We're all entitled to our own opinions. So, in my opinion, your opinion sucks.
Reply
#7
Great share. Will have a look at this in depth later. The guy you mentioned: 'Yukihiro "Matz" Matsumoto' Im sure he's the original inventor of the playstation :O
Reply
#8
Very helpful tutorial! I'll bookmark this to when i'll get some times to learn ruby. :-)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tut] How to install Ruby on Mac, Windows and Linux Jordan L. 13 8,441 12-13-2012, 07:49 AM
Last Post: L-Carnitine
  Ruby eBook sockatobi 7 3,065 12-13-2012, 07:48 AM
Last Post: L-Carnitine
  what is ruby on rails DaUB3R 3 2,032 11-01-2012, 04:20 AM
Last Post: johnnymward
  Should I Start Ruby? BreShiE 13 5,764 11-13-2011, 04:14 PM
Last Post: Speedy
  How to make a calculator in ruby. Soundwave 10 10,322 08-03-2011, 02:12 AM
Last Post: Boo‌

Forum Jump:


Users browsing this thread: 1 Guest(s)