Forum: Ruby on Rails develop multiple apps simultaneously how?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3504745159d79c585e4f7df8df76aa10?d=identicon&s=25 Ingo Weiss (ingoweiss)
on 2006-03-11 19:10
Hi,

I am very early into reading the "Agile Web Development 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
C1e5a9e9344b6d31b9df7303e6dc378a?d=identicon&s=25 Craig White (Guest)
on 2006-03-11 19:15
(Received via mailing list)
On Sat, 2006-03-11 at 19:10 +0100, Ingo Weiss wrote:
> Hi,
>
> I am very early into reading the "Agile Web Development 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
3504745159d79c585e4f7df8df76aa10?d=identicon&s=25 Ingo Weiss (ingoweiss)
on 2006-03-12 01:31
> 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
38feb557de2e4f82a82ddde0cf829258?d=identicon&s=25 Roland (Guest)
on 2006-03-12 01:59
That error happens because you have installed  lighttpd.

You must tell the application to use webrick by:

ruby script/server webrick -p 3001
Eeba234182bcbd7faed9ff52e233394d?d=identicon&s=25 Douglas Livingstone (Guest)
on 2006-03-12 02:48
(Received via mailing list)
2006/3/12, Roland <roland_mai@hotmail.com>:
> 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
6f7c877de704c7cc03c8a3b2dc52df92?d=identicon&s=25 Carmen --- (carmen)
on 2006-03-12 05:04
> 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"
11f9c4c75cf6216b93c154281f76e139?d=identicon&s=25 Muammar Kris Khaira (Guest)
on 2006-03-12 08:57
(Received via mailing list)
> 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
This topic is locked and can not be replied to.