SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Zealot sethtrain's Avatar
    Join Date
    Dec 2003
    Location
    Paducah, KY
    Posts
    174
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Running Ruby with Apache 2 and FastCGI

    I have everything working great and I am really excited about learning Ruby and Rails. But whenever I access my different defs in my controller it takes about 5 seconds before they are returned. I am working locally so I don't know what the issue is.

    Windows XP
    Apache 2.0.55
    Ruby 1.8.2
    Rails 1.0

    Anyone else had this issue?
    --
    sethtrain

  2. #2
    SitePoint Zealot HenriIV's Avatar
    Join Date
    Jun 2004
    Location
    France
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've already seen a message like yours but have no clue to help you except to update to Ruby 1.8.4 and check that you're using fastcgi

    Code:
    AddHandler fastcgi-script .fcgi
    in your Apache conf file

  3. #3
    SitePoint Guru silver trophy Luke Redpath's Avatar
    Join Date
    Mar 2003
    Location
    London
    Posts
    794
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I wouldn't bother with an Apache setup for local development anyway. Just use Webrick.

  4. #4
    SitePoint Zealot HenriIV's Avatar
    Join Date
    Jun 2004
    Location
    France
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sethtrain, did you fix your performance problem?

  5. #5
    SitePoint Zealot sethtrain's Avatar
    Join Date
    Dec 2003
    Location
    Paducah, KY
    Posts
    174
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah I got it fixed. I found "Ruby for Apache" and that FastCGI module is better than the one you get on the FastCGI site. I had to tune down my process with the FastCGIServer directive but after that was done it works like a charm.
    --
    sethtrain

  6. #6
    SitePoint Guru worchyld's Avatar
    Join Date
    Jul 2003
    Location
    Newcastle upon Tyne
    Posts
    909
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have they made installing Ruby on Rails on Windows easier, or is it the same process?

    I had Apache/PHP/MySQL running and setup the .http configuration file for Apache in the way I like to work for WAMP but whenever I tried RoR it just didn't work at all.

    I followed hints, tips, tutorials, ideas, concepts on using the FastCGI module, using this, that and the other and none of them worked and I gave up trying. RoR shouldn't be hard to install but for some reason it is.

    I did try Instant Rails which bundles PHP, MySQL, RoR, Apache2.0 all together, which is fine - except, what happens if you've already got Apache installed and running the way you want it, now you have to change your whole way of working just to get RoR working.

    Until somebody comes up with an ironclad way of making RoR work with Windows without all this messing around then I will move to Ruby -- until then I'll stick to PHP/MySQL.

  7. #7
    SitePoint Wizard samsm's Avatar
    Join Date
    Nov 2001
    Location
    Atlanta, GA, USA
    Posts
    5,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by worchyld
    now you have to change your whole way of working just to get RoR working.
    I don't think I understand what would be so disruptive to your workflow. I mean ... more disruptive than the fact that you are using a different language and a new framework.

    The canned suggestion for anyone using Rails is to just:
    ruby script/server
    http://localhost:3000/

    ... and I think after a while of working with Rails you decide whether the effort required to advance the environment is necessary/worthwhile. That doesn't work for you?
    Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?

  8. #8
    SitePoint Guru worchyld's Avatar
    Join Date
    Jul 2003
    Location
    Newcastle upon Tyne
    Posts
    909
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think, if memory serves me right, it did work... it just didn't wasn't intutitive what you were meant to do, I did get Ruby to work, and Rails... and made a simple hello world, but when it came to database's it had some kind of error (I can't remember now) about connection with mysql.

    But I did get it working with Instant Rails, but that is a whole package with PHP/Mysql, etc -- but it means having to use instant rails, and it seems to be a bit much to change the whole setup just to use RoR.

    I might try once more once I get the time.

  9. #9
    SitePoint Zealot sethtrain's Avatar
    Join Date
    Dec 2003
    Location
    Paducah, KY
    Posts
    174
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think it would be worth the shot. I switched from PHP to Coldfusion and now to RoR. It defintely was worth the hassle of trying to figure it out, but now I know and I could do it over again if need be.
    --
    sethtrain

  10. #10
    SitePoint Evangelist
    Join Date
    Feb 2006
    Location
    Worcs. UK
    Posts
    404
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sethtrain
    I have everything working great and I am really excited about learning Ruby and Rails. But whenever I access my different defs in my controller it takes about 5 seconds before they are returned. I am working locally so I don't know what the issue is.

    Windows XP
    Apache 2.0.55
    Ruby 1.8.2
    Rails 1.0

    Anyone else had this issue?
    This means the fastcgi isn't working.

    This guide details how to get it to work:

    Fast CGI and Apache2 for Windows XP

    I had a problem for a while until I realised that the line:

    Code:
    AddModule mod_fastcgi.c
    had to be added. The page has been updated so that the instructions now include this step.

    It's definitely worth the effort!!!!!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •