unable to specify port for site root

Skip to first unread message

Michael McLaughlin

May 9, 2014, 6:18:17 PM5/9/14
to serve...@googlegroups.com
hi all, here's what I'm typing, but as you can see, I'm still getting serve running on port 4000

[v3]$ serve 2000

[2014-05-09 17:16:08] INFO  WEBrick 1.3.1

[2014-05-09 17:16:08] INFO  ruby 2.1.0 (2013-12-25) [x86_64-darwin12.0]

[2014-05-09 17:16:08] INFO  WEBrick::HTTPServer#start: pid=8931 port=4000

anyone have an idea as to why this might be? I'm using thin right now, but this also happens with webrick.

Michael McLaughlin

May 9, 2014, 7:48:18 PM5/9/14
to serve...@googlegroups.com
alright, so i figured out how to hard code the default port number, which is nice, but I want this to be in a variable like it is in the documentation

#\ -p 2000

where I'm able to just start the serve rack on X port from the command line

Keenan Brock

May 13, 2014, 9:54:51 AM5/13/14
to serve...@googlegroups.com
Hi Michael.

I'm not sure about fixing the problem. But if you want it in a variable...

In config.ru, replace the 2000 with ENV["PORT"]

Then from the command line:
# PORT=2000 serve

# export PORT=2000

Good luck,
Reply all
Reply to author
0 new messages