How to start Ruby on linux system.

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
sarbas
Forum Commoner
Posts: 64
Joined: Thu Jan 04, 2007 5:51 am

How to start Ruby on linux system.

Post by sarbas »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hello every body,


I'm new person to linux. I already installed PHP5 and MYSql on my system. Now I installed Ruby on the same system. I dont know how to start Ruby in my system . Cos when I create a file with the extension of .rb in my localhost directory (/var/www/html/XXX.rb). And run through my browser but It show my ruby code only not the output.

I followed the same steps as viewing a PHP file, to view my ruby file like

Starting apache.
viewing through localhost...etc.

Is there any other procedure to view my output of the ruby file

But when I try with shell prompt I got the output like.

Code: Select all

[root@dhcppc0 ~]#env ruby

print "Hello\n";
^D
Hello
[root@dhcppc0 ~]#
And my ruby installation details;

Code: Select all

[root@dhcppc0 ~]# rpm -qa | grep ruby
ruby-devel-1.8.5.2-1.fc6
ruby-mode-1.8.5.2-1.fc6
eruby-libs-1.0.5-6.1
eruby-1.0.5-6.1
ruby-libs-1.8.5.2-1.fc6
ruby-1.8.5.2-1.fc6
[root@dhcppc0 ~]#

Thanks in advance...


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

You'll need to configure apache to parse the files:

http://wiki.rubyonrails.com/rails/pages ... dWithRails

should help.
Post Reply