# How to get DRb and Webrick to work together?

**URL:** <https://www.ruby-forum.com/t/how-to-get-drb-and-webrick-to-work-together/113533>\
**Category:** Ruby\
**Created:** [September 1, 2007, 7:49am UTC](https://www.ruby-forum.com/t/how-to-get-drb-and-webrick-to-work-together/113533 "2007-09-01T07:49:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssyed](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7ab992/32.png) [@ssyed](https://www.ruby-forum.com/u/ssyed)\
**Post date:** [September 1, 2007, 7:49am UTC](https://www.ruby-forum.com/t/how-to-get-drb-and-webrick-to-work-together/113533/1 "2007-09-01T07:49:26Z")

</div>

Hi,  
I’m trying to run Webrick and DRb on the same program. I run them on  
different ports. The problem is they both try to take over the entire  
process

$user[:drbserver]=DistributedSearch.new($user,$database)  
DRb.start\_service(“druby://localhost:#{$config[:drbport]}”,$user[:drbserver])

puts “Starting server process”

# Start the server thread.

server.start

The following code stops and I never get to start the webserver.

Can someone help? I’m new to ruby not sure how to set these up to run in  
their own threads properly.

---

<div class="post-metadata">

**Author:** ![ssyed](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7ab992/32.png) [@ssyed](https://www.ruby-forum.com/u/ssyed)\
**Post date:** [September 1, 2007, 10:48am UTC](https://www.ruby-forum.com/t/how-to-get-drb-and-webrick-to-work-together/113533/2 "2007-09-01T10:48:40Z")

</div>

Sal Syed wrote:

> Hi,  
> I’m trying to run Webrick and DRb on the same program. I run them on  
> different ports. The problem is they both try to take over the entire  
> process
> 
> $user[:drbserver]=DistributedSearch.new($user,$database)  
> DRb.start\_service(“druby://localhost:#{$config[:drbport]}”,$user[:drbserver])
> 
> puts “Starting server process”
> 
> # Start the server thread.
> 
> server.start
> 
> The following code stops and I never get to start the webserver.

service=DRb.start\_service(“druby://localhost:#{$config[:drbport]}”,$user[:drbserver])

Thread.new do  
while service != nil  
server.start  
end

Worth giving a shot…Also you might want to google ‘Ruby  
multithreading’ for more info on the subject.
