質問

Using Eclipse/Aptana, how can I change the default port for WEBrick from 3000 to anything else, using a configuration settings in the project? E.g. I want to be able to have multiple servers running for different projects on different ports.

I don't see where (in Eclipse or my project settings) I can set the port? I run the server by right-clicking the project and choosing "Run Server".

Using: Eclipse Kepler; Aptana Studio 3 (3.4.2)

役に立ちましたか?

解決

In Aptana Studio Go to Window > Show View > Servers.

There you can select to delete and update servers related to your apps.

他のヒント

You can set the port for WEBrick with the -p parameter. You should be able to append the param to your run configuration.

# ruby script/server -p 8080

There's also some other params which you might find useful:

# 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.
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top