簡體   English   中英

如何在eclipse中配置webrick端口?

[英]How to configure webrick port in eclipse?

使用Eclipse / Aptana,如何使用項目中的配置設置將WEBrick的默認端口從3000更改為其他任何內容? 例如,我希望能夠為不同端口上的不同項目運行多個服務器。

我沒有看到(在Eclipse或我的項目設置中)我可以設置端口? 我通過右鍵單擊項目並選擇“運行服務器”來運行服務器。

使用:Eclipse Kepler; Aptana Studio 3(3.4.2)

您可以使用-p參數為WEBrick設置端口。 您應該能夠將param附加到運行配置中。

# ruby script/server -p 8080

還有一些你可能會覺得有用的其他參數:

# ruby script/server --help
=> Booting WEBrick...
Usage: ruby server [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
-e, --environment=name           Specifies the environment to run this server under (test/development/production).
                                 Default: development
-m, --mime-types=filename        Specifies an Apache style mime.types configuration file to be used for mime types
                                 Default: none
-d, --daemon                     Make Rails run as a Daemon (only works if fork is available -- meaning on *nix).
-c, --charset=charset            Set default charset for output.
                                 Default: UTF-8

-h, --help                       Show this help message.

在Aptana Studio中轉到窗口>顯示視圖>服務器。

在那里,您可以選擇刪除和​​更新與您的應用相關的服務器。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM