Develop multiple apps simultaneously how?


#1

Hi,

I am very early into reading the “Agile Web D. with Rails”
book, so this will be a very basic question:

I tried starting another app simultaneously with the “depot” app, but
when I, after creating the database and the stub project try to start
the server, it tells me that the port is in use (of course it is, by the
depot application!). Can I tell the server to use a different port so
that I can play with multiple apps simultaneously?

Thanks!
Ingo


#2

On Sat, 2006-03-11 at 19:10 +0100, Ingo W. wrote:

Hi,

I am very early into reading the “Agile Web D. with Rails”
book, so this will be a very basic question:

I tried starting another app simultaneously with the “depot” app, but
when I, after creating the database and the stub project try to start
the server, it tells me that the port is in use (of course it is, by the
depot application!). Can I tell the server to use a different port so
that I can play with multiple apps simultaneously?


ruby script/server -p 3001

Craig


#3

ruby script/server -p 3001

Thanks, Craig!

Trange, but when I run the above command, the server seems to still try
to use port 3000:

ruby script/server -p 3001
=> Booting lighttpd (use ‘script/server webrick’ to force WEBrick)
=> Rails application started on http://0.0.0.0:3000
=> Call with -d to detach (requires absolute paths in
config/lighttpd.conf)
=> Ctrl-C to shutdown server (see config/lighttpd.conf for options)
2006-03-12 01:27:57: (network.c.265) can’t bind to port 3000 Address
already in use


#4

That error happens because you have installed lighttpd.

You must tell the application to use webrick by:

ruby script/server webrick -p 3001


#5

hmm, sounds buggy. Shouldn’t -p get passed on to lighttpd in this
case? Or is that not possible?

if you are using lighttpd, a simple solution not involving extra ports
or hostnames is changing up the root path

___lighttpd.conf:

$HTTP[“url”] =~ “^/a1” {
server.document-root = “/var/www/a1/public/”
alias.url = ( “/sbs/” => “/var/www/a1/public/” )
server.error-handler-404 = “/dispatch.fcgi”
fastcgi.server = ( “.fcgi” =>
( “localhost” =>
(
“min-procs” => 1,
“max-procs” => 1,
“socket” => “/var/www/a1/log/fcgi.socket”,
“bin-path” => “/var/www/a1/public/dispatch.fcgi”,
“bin-environment” => ( “RAILS_ENV” => “development” )
)
)
)
}
__config/:
ActionController::AbstractRequest.relative_url_root = “/a1”


#6

hmm, sounds buggy. Shouldn’t -p get passed on to lighttpd in this
case? Or is that not possible?

I think the server command only works with WEBrick. If you’re on
lightTPD, look for this line in /config/lighttpd.conf:

server.port = 3000


#7

2006/3/12, Roland removed_email_address@domain.invalid:

That error happens because you have installed lighttpd.

hmm, sounds buggy. Shouldn’t -p get passed on to lighttpd in this
case? Or is that not possible?

Douglas