Running Webrick server in background?

前端 未结 4 873
故里飘歌
故里飘歌 2021-02-05 15:00
MBPro:shovell myname$ ruby script/server
=> Booting WEBrick
=> Rails 2.3.8 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to         


        
4条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-05 15:53

    If you run rails s --help You will see a bunch of options

    Usage: rails server [mongrel, thin etc] [options]
        -p, --port=port                  Runs Rails on the specified port.
                                         Default: 3000
        -b, --binding=IP                 Binds Rails to the specified IP.
                                         Default: localhost
        -c, --config=file                Uses a custom rackup configuration.
        -d, --daemon                     Runs server as a Daemon.
        -u, --debugger                   Enables the debugger.
        -e, --environment=name           Specifies the environment to run this server under (test/development/production).
                                         Default: development
        -P, --pid=pid                    Specifies the PID file.
                                         Default: tmp/pids/server.pid
    
        -h, --help                       Shows this help message.
    

    The one that you need is to run it as a Daemon. Hence, the solution is: rails s -d

提交回复
热议问题