Ruby web server one-liner
It is possible to launch a web server from command line in current directory not only with python one-liner, but with ruby too:
ruby -rwebrick -e's=WEBrick::HTTPServer.new(:Port => 3000, :DocumentRoot => Dir.pwd).start'
Written by Julius
Related protips
4 Responses
You can also do 'ruby -run -e httpd . -p 5000'
over 1 year ago
·
Also, no need to assign the server instance (you can forego the s=...
bit.
over 1 year ago
·
Nice. Also you can make it a little more concise using 1.9+ hash notation, as in Port: 3000 instead of :Port => 3000.
over 1 year ago
·
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#