# Problems getting WEBrick server up and running (new to ruby)

**URL:** <https://www.ruby-forum.com/t/problems-getting-webrick-server-up-and-running-new-to-ruby/64617>\
**Category:** Rails\
**Created:** [August 15, 2006, 1:08pm UTC](https://www.ruby-forum.com/t/problems-getting-webrick-server-up-and-running-new-to-ruby/64617 "2006-08-15T13:08:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![javamllama](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ce7236/32.png) [@javamllama](https://www.ruby-forum.com/u/javamllama)\
**Post date:** [August 15, 2006, 1:08pm UTC](https://www.ruby-forum.com/t/problems-getting-webrick-server-up-and-running-new-to-ruby/64617/1 "2006-08-15T13:08:59Z")

</div>

Hello,

I installed ruby and rails on Monday as I have been hearing great things  
about both the ruby language and rails framework.

Installation went smoothly but I am having problems launching a WEBrick  
server so see what my newly created rails app is doing!

My ruby/ rails installation:

1. Installed ruby directly by compiling the source code.
2. Working on a windows pc, using cygwin to run / compile etc.
3. Ruby appears to be installed correctly and I have been able to  
successfully run code.
4. Rails installed through ruby gems.
5. Rails appears to be installed correctly i.e. running rails testapp  
ins cygwin creates all the expected directories for a testapp  
application.
6. Using MySQL to create databases, appears to be installed correctly I  
can run SQL from the cygwin command line, create databases tables etc.
7. Created the appropriate databases for the apps and info matches up  
with database config file.

Problem:

When I try and start a WEBrick server

i.e. navigate to testApp directory in cygwin and run â??ruby  
./script/serverâ??

it just hangs. There is no output to the screen and I cannot connect to  
[http://localhost:3000](http://localhost:3000).

I am pretty sure this is nothing to with the testApp itself as if I  
create a clean rails application and try and start the web server the  
same thing happens.

Has anyone experienced a problem similar to this or have any advice?

Thanks in advance for any replies.

Matt.

P.S  
You can ssume my technical skill is low, not only am I new to ruby and  
rails, Iâ??m pretty new to programming in general. I am quite capable of  
following instructions however!

---

<div class="post-metadata">

**Author:** ![javamllama](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ce7236/32.png) [@javamllama](https://www.ruby-forum.com/u/javamllama)\
**Post date:** [August 16, 2006, 12:55am UTC](https://www.ruby-forum.com/t/problems-getting-webrick-server-up-and-running-new-to-ruby/64617/2 "2006-08-16T00:55:05Z")

</div>

You may want to try the ruby one-click installer:  
[http://rubyinstaller.rubyforge.org/wiki/wiki.pl](http://rubyinstaller.rubyforge.org/wiki/wiki.pl)

What happens if you press Ctrl-C in the console where you started  
WEBrick? I had a case where this would then start the server correctly  
after seemingly hanging.

Max

---

<div class="post-metadata">

**Author:** ![javamllama](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ce7236/32.png) [@javamllama](https://www.ruby-forum.com/u/javamllama)\
**Post date:** [August 16, 2006, 3:22pm UTC](https://www.ruby-forum.com/t/problems-getting-webrick-server-up-and-running-new-to-ruby/64617/3 "2006-08-16T15:22:19Z")

</div>

Max M. wrote:

> You may want to try the ruby one-click installer:  
> [http://rubyinstaller.rubyforge.org/wiki/wiki.pl](http://rubyinstaller.rubyforge.org/wiki/wiki.pl)
> 
> What happens if you press Ctrl-C in the console where you started  
> WEBrick? I had a case where this would then start the server correctly  
> after seemingly hanging.
> 
> Max

Hi Max,

Thanks for the reply,

Both crtl-c and ctrl-d fail to exit after hanging. The console does not  
seem to respond to any commands. Do you think it is worth me trying to  
reinstall ruby by compiling the src code again? Could I have installed  
the WEBrick portion incorrectly?

I’d like to get familiar with the installing from src code procedure so  
I would prefer to use the compiling from src install method rather than  
the one-click method.

Cheers,

Matt.

---

<div class="post-metadata">

**Author:** ![javamllama](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ce7236/32.png) [@javamllama](https://www.ruby-forum.com/u/javamllama)\
**Post date:** [August 17, 2006, 12:28am UTC](https://www.ruby-forum.com/t/problems-getting-webrick-server-up-and-running-new-to-ruby/64617/4 "2006-08-17T00:28:13Z")

</div>

I’d try the one-click method first, to see if it is a problem with  
your system setup somehow. If that does work, you’ll know you have a  
problem with your compile procedure.

In my experience, unless you want to run the very latest bleeding-edge  
version of Ruby (which I would not recommend anyway), you will not  
need to compile Ruby. Ever. There are precompiled packages out there  
for almost every environment. There is no benefit in compiling Ruby  
yourself.

If you really want to get familiar with building packages from source,  
I recommend picking a different target (for example Lighttpd).

Cheers,  
Max

---

<div class="post-metadata">

**Author:** ![javamllama](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ce7236/32.png) [@javamllama](https://www.ruby-forum.com/u/javamllama)\
**Post date:** [March 26, 2007, 3:33pm UTC](https://www.ruby-forum.com/t/problems-getting-webrick-server-up-and-running-new-to-ruby/64617/5 "2007-03-26T15:33:09Z")

</div>

> I ran into exactly the same problem when using Ruby as installed by the  
> Cygwin environment. Here is what worked for me – it may or may not  
> work for you as you compiled Ruby yourself…
> 
> ruby script/server webrick
> 
> This forces it to try to use webrick instead of lighhtpd – I had  
> assumed that it would default to webrick but apparently this is not the  
> case due to something weird going on with Cygwin. It tries to evaluate  
> `lighhtpd -version` deep down in the library, which is apparently  
> hanging. By specifying webrick directly on the command line, this step  
> is bypassed, and I was able to get webrick up and running.
> 
> Hope this helps.  
> -C.

Thanks for the solution! I had the same problem and now it works!

---

<div class="post-metadata">

**Author:** ![javamllama](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ce7236/32.png) [@javamllama](https://www.ruby-forum.com/u/javamllama)\
**Post date:** [September 16, 2006, 6:51am UTC](https://www.ruby-forum.com/t/problems-getting-webrick-server-up-and-running-new-to-ruby/64617/6 "2006-09-16T06:51:41Z")

</div>

Matt G. wrote:

> When I try and start a WEBrick server
> 
> i.e. navigate to testApp directory in cygwin and run â??ruby  
> ./script/serverâ??
> 
> it just hangs. There is no output to the screen and I cannot connect to  
> [http://localhost:3000](http://localhost:3000).

I ran into exactly the same problem when using Ruby as installed by the  
Cygwin environment. Here is what worked for me – it may or may not  
work for you as you compiled Ruby yourself…

ruby script/server webrick

This forces it to try to use webrick instead of lighhtpd – I had  
assumed that it would default to webrick but apparently this is not the  
case due to something weird going on with Cygwin. It tries to evaluate  
`lighhtpd -version` deep down in the library, which is apparently  
hanging. By specifying webrick directly on the command line, this step  
is bypassed, and I was able to get webrick up and running.

Hope this helps.  
-C.
