How to run script/server in a thread?

I have an application in which a server part has been written using
rails, and the client part using firewatir. I would like to fire both
up with a single command. What mistake am I making below? I am
running this from the app root folder, where I am able to fire up irb
and successfully feed it exec(‘script/server’).

Warmly, Arun

#!/usr/bin/env ruby
require ‘rubygems’
#Include the FireWatir file.
require ‘firewatir’
#include the FireWatir Module.
include FireWatir
sleep(3) #to give the server time to start. Is there a better way?
sleep (5)

Your error is the use of exec() - exec() overwrites the whole process
(all threads) with the new program. Use the system() instead…


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs