Juicy lil' bytes

Simple Local HTTP Server With Ruby

You can do it with Python. And you can do it with Ruby. The Ruby one line command for a local HTTP server.

One Line Ruby HTTP Server

Navigate to your local site directory and then use the following command:

One Line Ruby HTTP ServerSource
ruby -run -e httpd . -p 8000

You can access your site at http://localhost:8000. If you want to change the port, modify the argument after the -p switch. I confirmed that this works with Ruby v1.9.3.


Don’t know what version of Ruby you have (or if it is installed)? Use the command ruby --version and you will know.

Kudos Dallas Reedy via Coderwall