0

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)

Josh M.
  • 26,437
  • 24
  • 119
  • 200

2 Answers2

1

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.
KappaNossi
  • 2,656
  • 1
  • 15
  • 17
  • Thanks, I don't see where (in Eclipse or my project settings) I can set the port - do you know? I run the server by right-clicking the project and choosing "Run Server". – Josh M. Sep 20 '13 at 13:08
  • I can't point you there exactly since I haven't used Eclipse in years but you should be able to add arguments to your run configuration. To open the dialog, I think you can open the dropdown next to the green circle with the white 'play' icon in it. It's right above your editor in the quick access bar. – KappaNossi Sep 20 '13 at 13:14
1

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

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

techvineet
  • 5,041
  • 2
  • 30
  • 28