Ruby & Rails

Ruby location:

 

/usr/local/bin/ruby19

 

/usr/local/bin/ruby20

 

/usr/local/bin/ruby21

 

 

Example Ruby:

 

 

#!/usr/local/bin/ruby

$i = 0
$num = 4

until $i > $num  do
     puts("UnixSSH No. = #$i" )
   $i +=1;
end

 

Example Rails:

 

rails new app

cd app

ruby script/rails server -p 1234

 

 

RubyGems server:


gem --help

gem help server

Index :

gem generate_index

Run server :

gem server -p 3333

Test:

http://IP:3333/

 

Live Free Or Die!