Ruby + Apache, scripts not being interpreted

Discussion in 'Ruby' started by nobrow, Oct 13, 2007.

  1. nobrow

    nobrow Guest

    I am trying to get Ruby running on Apache. I may or may not have a
    problem. What do you think?

    I have a test site called ruby-test set up with a vhost. When I go to
    rails-test/ I see the "Welcome Aboard" page. But when I click the
    "About your application's environment" link the script doesnt get
    interpreted ... I just see it as text. I havent gone any further than
    this, as I have been trying to get that script to run.

    rails-test/public/.htaccess looks like:

    AddHandler fcgid-script .fcgi
    Options +FollowSymLinks +ExecCGI
    RewriteEngine On
    RewriteRule ^$ index.html [QSA]
    RewriteRule ^([^.]+)$ $1.html [QSA]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
    ErrorDocument 500 "<h2>Application error</h2>Rails application failed
    to start properly"

    The vhost .conf for the site looks like:

    <VirtualHost *:80>
    DocumentRoot "/var/www/webroot/rails-test/public"
    ServerName rails-test
    <Directory "/var/www/webroot/rails-test/public">
    Options ExecCGI FollowSymLinks
    AllowOverride all
    Order allow,deny
    Allow from all
    </Directory>
    </VirtualHost>

    Is the problem that the .rb file that the link points to is in a
    directory that doesnt have +ExecCGI set? What must I do to fix this?
    Am quite stuck.

    I guess one solution is to get mod_ruby working right? But I cant
    figure out how to check if it is working already, or find a set of
    instructions how to install it.

    Help greatly appreciated, thanks.
     
    nobrow, Oct 13, 2007
    #1
    1. Advertising

  2. nobrow

    nobrow Guest

    On Oct 13, 11:07 am, nobrow <> wrote:
    > I am trying to get Ruby running on Apache. I may or may not have a
    > problem. What do you think?
    >
    > I have a test site called ruby-test set up with a vhost. When I go to
    > rails-test/ I see the "Welcome Aboard" page. But when I click the
    > "About your application's environment" link the script doesnt get
    > interpreted ... I just see it as text. I havent gone any further than
    > this, as I have been trying to get that script to run.
    >
    > rails-test/public/.htaccess looks like:
    >
    > AddHandler fcgid-script .fcgi
    > Options +FollowSymLinks+ExecCGI
    > RewriteEngine On
    > RewriteRule ^$ index.html [QSA]
    > RewriteRule ^([^.]+)$ $1.html [QSA]
    > RewriteCond %{REQUEST_FILENAME} !-f
    > RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
    > ErrorDocument 500 "<h2>Application error</h2>Railsapplication failed
    > to start properly"
    >
    > The vhost .conf for the site looks like:
    >
    > <VirtualHost *:80>
    > DocumentRoot "/var/www/webroot/rails-test/public"
    > ServerName rails-test
    > <Directory "/var/www/webroot/rails-test/public">
    > Options ExecCGI FollowSymLinks
    > AllowOverride all
    > Order allow,deny
    > Allow from all
    > </Directory>
    > </VirtualHost>
    >
    > Is the problem that the .rb file that the link points to is in a
    > directory that doesnt have +ExecCGI set? What must I do to fix this?
    > Am quite stuck.
    >
    > I guess one solution is to get mod_ruby working right? But I cant
    > figure out how to check if it is working already, or find a set of
    > instructions how to install it.
    >
    > Help greatly appreciated, thanks.


    Bump
     
    nobrow, Oct 22, 2007
    #2
    1. Advertising

  3. nobrow

    John Joyce Guest

    On Oct 22, 2007, at 12:05 PM, nobrow wrote:

    > On Oct 13, 11:07 am, nobrow <> wrote:
    >> I am trying to get Ruby running on Apache. I may or may not have a
    >> problem. What do you think?
    >>
    >> I have a test site called ruby-test set up with a vhost. When I go to
    >> rails-test/ I see the "Welcome Aboard" page. But when I click the
    >> "About your application's environment" link the script doesnt get
    >> interpreted ... I just see it as text. I havent gone any further than
    >> this, as I have been trying to get that script to run.
    >>
    >> rails-test/public/.htaccess looks like:
    >>
    >> AddHandler fcgid-script .fcgi
    >> Options +FollowSymLinks+ExecCGI
    >> RewriteEngine On
    >> RewriteRule ^$ index.html [QSA]
    >> RewriteRule ^([^.]+)$ $1.html [QSA]
    >> RewriteCond %{REQUEST_FILENAME} !-f
    >> RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
    >> ErrorDocument 500 "<h2>Application error</h2>Railsapplication failed
    >> to start properly"
    >>
    >> The vhost .conf for the site looks like:
    >>
    >> <VirtualHost *:80>
    >> DocumentRoot "/var/www/webroot/rails-test/public"
    >> ServerName rails-test
    >> <Directory "/var/www/webroot/rails-test/public">
    >> Options ExecCGI FollowSymLinks
    >> AllowOverride all
    >> Order allow,deny
    >> Allow from all
    >> </Directory>
    >> </VirtualHost>
    >>
    >> Is the problem that the .rb file that the link points to is in a
    >> directory that doesnt have +ExecCGI set? What must I do to fix this?
    >> Am quite stuck.
    >>
    >> I guess one solution is to get mod_ruby working right? But I cant
    >> figure out how to check if it is working already, or find a set of
    >> instructions how to install it.
    >>
    >> Help greatly appreciated, thanks.

    >
    > Bump
    >
    >

    Rails Talk will be your best source of an answer for this.
     
    John Joyce, Oct 23, 2007
    #3
  4. nobrow

    James Britt Guest

    nobrow wrote:
    > I am trying to get Ruby running on Apache. I may or may not have a
    > problem. What do you think?
    >
    > I have a test site called ruby-test set up with a vhost. When I go to
    > rails-test/ I see the "Welcome Aboard" page. But when I click the
    > "About your application's environment" link the script doesnt get
    > interpreted ... I just see it as text. I havent gone any further than
    > this, as I have been trying to get that script to run.


    You also may have to tell apache that files ending in .rb are to be
    handled via cgi. Otherwise, it really is just text.


    AddHandler cgi-script .rb


    Check the archives for threads on Ruby + CGI


    --
    James Britt

    "The greatest obstacle to discovery is not ignorance, but the illusion
    of knowledge."
    - D. Boorstin
     
    James Britt, Oct 23, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dan Whitaker
    Replies:
    7
    Views:
    525
    kchayka
    Dec 1, 2003
  2. Steve C. Orr [MCSD, MVP, CSM, ASP Insider]

    Re: .aspx pages not being interpreted

    Steve C. Orr [MCSD, MVP, CSM, ASP Insider], Jul 2, 2008, in forum: ASP .Net
    Replies:
    0
    Views:
    379
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
    Jul 2, 2008
  3. Minkoo Seo
    Replies:
    1
    Views:
    143
    Yukihiro Matsumoto
    Mar 11, 2006
  4. Erwin Moller
    Replies:
    9
    Views:
    134
    Clifford Heath
    May 8, 2008
  5. ad
    Replies:
    3
    Views:
    209
    Ryan Davis
    Dec 29, 2009
Loading...

Share This Page