Search code examples
rubymobilejekylladobe-edge

Jekyll server not working in mobile browser


I'm currently receiving an error when trying to view a Jekyll site using Adobe edge inspector. Im using the built in Jekyll development server in port:4000. Furthermore is the Jekyll site in question does not appear within my Safari mobile browser.

Heres how i start up the server

jekyll serve --watch 

and here are the outputs

 Generating...                     done.
 Auto-regeneration: enabled for '/Users/auser/Sites/user.me/code'
 Configuration file: /Users/auser/Sites/user.me/code/_config.yml
 Server address: http://127.0.0.1:4000/
 Server running... press ctrl-c to stop.

How can I get this to work in my mobile browser?


Solution

  • As you can observe in the Output: (Server address: http://127.0.0.1:4000/), Jekyll only answers request coming from the local machine.

    To make Jekyll answer on all adresses, use the -H option. From jekyll serve --help:

    -H, --host [HOST]  Host to bind to
    

    use as follows:

    jekyll serve --watch -H 0.0.0.0