首页 > 如何设置rails服务监听的ip和端口?

如何设置rails服务监听的ip和端口?

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


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.
【热门文章】
【热门文章】