如何更改webrick的端口

18 views
Skip to first unread message

yuexingfu

unread,
Oct 18, 2007, 2:16:07 AM10/18/07
to rails4scm
本方案是用netbeans6 m10 来开发的,所以采用的是jruby

[1] 在 netbeans 里面修改[也就是说用netbeans来来启动]
选择项目点击右键-选择属性,然后更改端口。

[2] 单独启动webrick时更改端口
在"%JRUBY_HOME%\lib\ruby\gems\1.8
\gems\rails-1.2.3\lib\commands\servers"里面找到"webrick.rb"该文件。
把里面的端口改成需要的。
OPTIONS = {
:port => 3000,
:ip => "0.0.0.0",
:environment => (ENV['RAILS_ENV'] || "development").dup,
:server_root => File.expand_path(RAILS_ROOT + "/public/"),
:server_type => WEBrick::SimpleServer,
:charset => "UTF-8",
:mime_types => WEBrick::HTTPUtils::DefaultMimeTypes
}

把:port=> 3000 改称想要的端口。

Reply all
Reply to author
Forward
0 new messages