ruby - 如何设置rails服务监听的ip和端口?
黄舟
黄舟 2017-04-21 11:15:53
0
1
761

我最近才开始在raspberry pi 上学习rails,我只能通过ssh 链接上pi,但是rails tutorial教程里的范例是把程序监听127.0.0.1:3000,这个地址我在其它主机是无法访问的。那么请问rails是在哪里设置ip的,我想把它设置为192.168.1.100?

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

membalas semua(1)
迷茫

rails -s -b 0.0.0.0

$ rails s --help
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: 0.0.0.0
    -c, --config=file                Use custom rackup configuration file
    -d, --daemon                     Make server run as a Daemon.
    -u, --debugger                   Enable ruby-debugging for the server.
    -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                       Show this help message.
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan