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.
Ingo W. (Guest)
on 2006-03-11 20:10
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
Craig W. (Guest)
on 2006-03-11 20:15
(Received via mailing list)
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
Ingo W. (Guest)
on 2006-03-12 02: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
Roland (Guest)
on 2006-03-12 02:59
That error happens because you have installed  lighttpd.

You must tell the application to use webrick by:

ruby script/server webrick -p 3001
Douglas L. (Guest)
on 2006-03-12 03:48
(Received via mailing list)
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
Carmen -. (Guest)
on 2006-03-12 06: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"
Muammar Kris Khaira (Guest)
on 2006-03-12 09: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.