Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Runy newbie question

Reply
Thread Tools

Runy newbie question

 
 
Nick
Guest
Posts: n/a
 
      02-06-2007
Dear all,

I'm a newbie at ruby and I have a few simple problems. First I
installed apache and ruby on rails using the guide at
www.apacheguide.org. It appears to work fine.

Now, I have a ruby script that returns an XML file depending on the
input parameters. This script works nicely when run from the windows
command line.

However, I'm puzzled on how to launch it after a user clicks on the
"Submit" button on my website. What happens now, is that IE or FF
wants to download the .rb file.

Do you have any good online examples to share ?

Thank you,

Nick,

 
Reply With Quote
 
 
 
 
Harry
Guest
Posts: n/a
 
      03-01-2007
> Now, I have a ruby script that returns an XML file depending on the
> input parameters. This script works nicely when run from the windows
> command line.
>
> However, I'm puzzled on how to launch it after a user clicks on the
> "Submit" button on my website. What happens now, is that IE or FF
> wants to download the .rb file.
>


It works on your computer when you click the submit button but not on
your website when you click submit?

Harry

--
http://www.kakueki.com/ruby/list.html
Japanese Ruby List Subjects in English

 
Reply With Quote
 
 
 
 
Tim Becker
Guest
Posts: n/a
 
      03-01-2007
The problem is that your ruby script is also a text file and apache
doesn't know if you'd just like to give back a text file or execute
the script. Per default, it does the safer option, which is just
return the text.
> This script works nicely when run from the windows
> command line.
>
> However, ... on my website, ... IE or FF
> wants to download the .rb file.


You need to configure the server to handle cgis. You can either do
this in the global Apache configuration or in a file called
`.htaccess` which alters the configuration for the directory you're
located in. You'll need to require something along the lines of:

Options +ExecCGI

to instruct the server that execution of cgi's is generally allowed, and:

AddHandler cgi-script rb

for Apache to treat .rb files as cgi's. Not sure how this is handled
on Windows, but the script also needs to be executable (chmod +x on
unix).

Sort through the Apache manual, start here:
http://httpd.apache.org/docs/1.3/how...ccess.html#cgi

Cheers,
-tim

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VONAGE Newbie w/newbie question New_kid@nowhere.new VOIP 0 08-11-2007 01:40 PM
another newbie question from another newbie.... Lee UK VOIP 4 05-17-2005 04:10 PM
newbie: cisco vlan newbie question No Spam Cisco 3 06-07-2004 10:02 AM
dumb newbie question (or newbie dumb question) Jerry C. Perl Misc 8 11-23-2003 04:11 AM
Python - Runy Tkinter conflict Adam Python 0 07-31-2003 08:37 AM



Advertisments