# Instant Rails SCGI Problem

**URL:** <https://www.ruby-forum.com/t/instant-rails-scgi-problem/57594>\
**Category:** Rails\
**Created:** [April 12, 2006, 9:41am UTC](https://www.ruby-forum.com/t/instant-rails-scgi-problem/57594 "2006-04-12T09:41:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnnybutler7](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Post date:** [April 12, 2006, 9:41am UTC](https://www.ruby-forum.com/t/instant-rails-scgi-problem/57594/1 "2006-04-12T09:41:43Z")

</div>

I have installed instant rails and configured it  
[http://instantrails.rubyforge.org/wiki/wiki.pl?Getting\_Started](http://instantrails.rubyforge.org/wiki/wiki.pl?Getting_Started)

I can get typo and webrick to work on webrick localhost:3000 but cant  
get anything to work with scgi.

When i start the scgi server i get a blank dos window screen. When i  
type [www.mycookbook.com](http://www.mycookbook.com) into the browser i get the following

Unable to connect  
Firefox can’t establish a connection to the server at  
[www.mycookbook.com](http://www.mycookbook.com).

I have looked at the common errors at the bottom of the page below but  
none of them seem to help.  
[http://instantrails.rubyforge.org/wiki/wiki.pl?Getting\_Started](http://instantrails.rubyforge.org/wiki/wiki.pl?Getting_Started)

I have added the following to the bottom of the windows host file  
127.0.0.1 [www.mycookbook.com](http://www.mycookbook.com)  
127.0.0.1 typo

Anyone help?

---

<div class="post-metadata">

**Author:** ![johnnybutler7](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Post date:** [April 12, 2006, 1:14pm UTC](https://www.ruby-forum.com/t/instant-rails-scgi-problem/57594/2 "2006-04-12T13:14:22Z")

</div>

On 4/12/06, John B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Firefox can’t establish a connection to the server at  
> Anyone help?  
> It sounds like apache isn’t runing. Does the Instant Rails manager  
> show a “green” status for apache (indicating that it is up and  
> running)?

Also, check the apache access log and error log to see if there are  
any clues. You can open these via the Instant Rails main menu: I\>\>Log  
Files

Curt

---

<div class="post-metadata">

**Author:** ![johnnybutler7](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Post date:** [April 12, 2006, 1:58pm UTC](https://www.ruby-forum.com/t/instant-rails-scgi-problem/57594/3 "2006-04-12T13:58:27Z")

</div>

Both Apache and MySQL have a green light. There are no entries in the  
apache access log or error log.

---

<div class="post-metadata">

**Author:** ![johnnybutler7](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Post date:** [April 12, 2006, 3:42pm UTC](https://www.ruby-forum.com/t/instant-rails-scgi-problem/57594/4 "2006-04-12T15:42:02Z")

</div>

John B. wrote:

> Both Apache and MySQL have a green light. There are no entries in the  
> apache access log or error log.

Add the following batch file to your application’s folder and use it to  
start SCGI:

SET RUBY\_HOME=%CD%…\ruby  
SET MYSQL\_HOME=%CD%…\mysql  
SET PATH=%RUBY\_HOME%\bin;%MYSQL\_HOME%\bin;  
call ruby %RUBY\_HOME%\bin\scgi\_service  
pause

If there is an error, the pause in the batch file will let to see what  
happened

Ed

p.s.  
I like to see in the SCGI console which app is running, so I added the  
following change which is just cosmetic.

To display the environment and the port in the SCGI console window,  
instead of the current blank window, I made the following changes:

C:\InstantRails-1.2\ruby\lib\ruby\gems\1.8\gems\scgi\_rails-0.4.3\bin\scgi\_service  
\<typo:code lang=“ruby”\>

# Added Port for display – Ed Gard

def configure\_rails(environment, port)  
ENV[“RAILS\_ENV”] = environment  
# Added to display environment and port – Ed Gard  
STDERR.puts(“Environment: #{environment}; Port: #{port}”)  
require “config/environment”  
ActiveRecord::Base.threaded\_connections = false  
require ‘dispatcher’  
end

class RailsController \< SCGI::Controller  
def initialize(config\_file)  
@config\_file = config\_file  
# Added the port for display – Ed Gard  
configure\_rails(config[:env], config[:port])  
super(RailsProcessor.new(config))  
end  
\</typo:code\>

---

<div class="post-metadata">

**Author:** ![johnnybutler7](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Post date:** [April 13, 2006, 3:47pm UTC](https://www.ruby-forum.com/t/instant-rails-scgi-problem/57594/5 "2006-04-13T15:47:00Z")

</div>

On 4/12/06, John B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Both Apache and MySQL have a green light. There are no entries in the  
> apache access log or error log.

What version of windows are you running? This should work on Windows  
2000 and Windows XP, but not on Windows 98.

Are you running anything else that might be using port 80 (skype, for  
example, does this)? This should be detected by Apache, but I’m just  
trying to cover all the bases here.

Curt
