"Permission denied" when attempting to Jekyll serve on Android


#1

I’m attempting to localhost a website on my Android tablet. I’m working in Termux, and have not rooted the device. When I attempt run ‘jekyll serve’, I get the error “jekyll 3.8.5 | Error: Permission denied @ rb_sysopen - /proc/version”

Jekyll 3.8.5
Ruby 2.6.1p33

Verbose attempt
jekyll serve --verbose
Logging at level: debug
Configuration file: /data/data/com.termux/files/home/portfolio/idtx314.github.io/_config.yml
Logging at level: debug
Source: /data/data/com.termux/files/home/portfolio/idtx314.github.io
Destination: /data/data/com.termux/files/home/portfolio/idtx314.github.io/_site
Incremental build: disabled. Enable with --incremental
Generating…
Reading: _projects/03-project-3.md
Reading: _projects/08-project-8.md
Reading: _projects/07-project-7.md
Reading: _projects/04-project-4.md
Reading: _projects/02-project-2.md
Reading: _projects/01-project-1.md
Rendering: _projects/01-project-1.md
Pre-Render Hooks: _projects/01-project-1.md
Rendering Markup: _projects/01-project-1.md
Rendering Layout: _projects/01-project-1.md
Layout source: site
Rendering: _projects/02-project-2.md
Pre-Render Hooks: _projects/02-project-2.md
Rendering Markup: _projects/02-project-2.md
Rendering Layout: _projects/02-project-2.md
Layout source: site
Rendering: _projects/03-project-3.md
Pre-Render Hooks: _projects/03-project-3.md
Rendering Markup: _projects/03-project-3.md
Rendering Layout: _projects/03-project-3.md
Layout source: site
Rendering: _projects/04-project-4.md
Pre-Render Hooks: _projects/04-project-4.md
Rendering Markup: _projects/04-project-4.md
Rendering Layout: _projects/04-project-4.md
Layout source: site
Rendering: _projects/08-project-8.md
Pre-Render Hooks: _projects/08-project-8.md
Rendering Markup: _projects/08-project-8.md
Rendering Layout: _projects/08-project-8.md
Layout source: site
Rendering: _projects/07-project-7.md
Pre-Render Hooks: _projects/07-project-7.md
Rendering Markup: _projects/07-project-7.md
Rendering Layout: _projects/07-project-7.md
Layout source: site
Rendering: about.md
Pre-Render Hooks: about.md
Rendering Markup: about.md
Rendering Layout: about.md
Layout source: site
Rendering: contact.md
Pre-Render Hooks: contact.md
Rendering Markup: contact.md
Rendering Layout: contact.md
Layout source: site
Rendering: feed.xml
Pre-Render Hooks: feed.xml
Rendering Liquid: feed.xml
Rendering Markup: feed.xml
Rendering: index.html
Pre-Render Hooks: index.html
Rendering Liquid: index.html
Rendering Markup: index.html
Rendering Layout: index.html
Layout source: site
Writing: /data/data/com.termux/files/home/portfolio/idtx314.github.io/_site/about/index.html
Writing: /data/data/com.termux/files/home/portfolio/idtx314.github.io/_site/contact/index.html
Writing: /data/data/com.termux/files/home/portfolio/idtx314.github.io/_site/feed.xml
Writing: /data/data/com.termux/files/home/portfolio/idtx314.github.io/_site/index.html
Writing: /data/data/com.termux/files/home/portfolio/idtx314.github.io/_site/project-1.html
Writing: /data/data/com.termux/files/home/portfolio/idtx314.github.io/_site/project-2.html
Writing: /data/data/com.termux/files/home/portfolio/idtx314.github.io/_site/project-3.html
Writing: /data/data/com.termux/files/home/portfolio/idtx314.github.io/_site/project-4.html
Writing: /data/data/com.termux/files/home/portfolio/idtx314.github.io/_site/project-8.html
Writing: /data/data/com.termux/files/home/portfolio/idtx314.github.io/_site/project-7.html
done in 3.15 seconds.
jekyll 3.8.5 | Error: Permission denied @ rb_sysopen - /proc/version

Trace attempt
jekyll serve --trace
Configuration file: /data/data/com.termux/files/home/portfolio/idtx314.github.io/_config.yml
Source: /data/data/com.termux/files/home/portfolio/idtx314.github.io
Destination: /data/data/com.termux/files/home/portfolio/idtx314.github.io/_site
Incremental build: disabled. Enable with --incremental
Generating…
done in 3.493 seconds.
Traceback (most recent call last):
17: from /data/data/com.termux/files/usr/bin/jekyll:23:in <main>' 16: from /data/data/com.termux/files/usr/bin/jekyll:23:inload’
15: from /data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/exe/jekyll:15:in <top (required)>' 14: from /data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:inprogram’
13: from /data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in go' 12: from /data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:inexecute’
11: from /data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in each' 10: from /data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:inblock in execute’
9: from /data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/commands/serve.rb:75:in block (2 levels) in init_with_program' 8: from /data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/commands/serve.rb:93:instart’
7: from /data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/commands/serve.rb:93:in each' 6: from /data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/commands/serve.rb:93:inblock in start’
5: from /data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/commands/build.rb:43:in process' 4: from /data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/commands/build.rb:77:inwatch’
3: from /data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/utils/platforms.rb:40:in bash_on_windows?' 2: from /data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/jekyll-3.8.5/lib/jekyll/utils/platforms.rb:75:inproc_version’
1: from /data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/pathutil-0.16.2/lib/pathutil.rb:502:in read' /data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/pathutil-0.16.2/lib/pathutil.rb:502:inread’: Permission denied @ rb_sysopen - /proc/version (Errno::EACCES)

Appears related to


And

, But that issue was ostensibly patched last September.


#2

True. But that patch has not been released yet.


#3

I wasn’t quite sure how to check which version the fix was pulled into. That’ll be my limited experience with github showing. In that case, I’ll try to figure out where jekyll is on this system. Maybe I can edit the fix in without needing sudo.


#4

If there’s a Gemfile, and you’ve bundler installed, then you can simply run

bundle show jekyll

#5

That got me there. I can confirm that the changes mentioned int he patch resolve the permission issue on my tablet.
Unfortunately my website breaks terribly when I try to host it this way (the format of the main index is a wreck, the links on it say the address can’t be found, and the headers and footers seem to not process correctly), but I have no reason to think that’s related.


#6

Is the source repository public?
Or the hosted website URL…?


#7

Sorry for the delay! I hadnt expected more help.

The website is my portfolio, you can see the working version on GitHub pages here: https://idtx314.github.io
I have the repository here:
https://github.com/idtx314/idtx314.github.io

I modified the whole thing from a template, so I only know some of what I’m doing.

I’m attempting to locally host a copy of the repo on an Android tablet, so that I’m not reliant on an internet connection. When I Jekyll host the landing page looks like this:

Clicking on the project links goes to dead pages, “This site can’t be reached”, “server IP address could not be found”, “ERR_NAME_NOT_RESOLVED”.

My first guess is that there are pathways in the code that no longer resolve correctly in their new location, but I haven’t gotten back around to validating that yet.

I’ve also tried hosting the contents of _site/ on an HTTP server app, which showed similar issues. The only extra data from there was that when I accessed the project pages directly I found that the images in the body load fine, while the header image does not.


#8

This is the principal issue actually. Jekyll generates static sites that need a “server” to resolve links appropriately. If you look at the “HTML source code” of your site, you’ll see links like /public/stylesheets/style.css. The slash / at the beginning means “resource at the root”.
When the site is served via a server, “the root” means root of your site. But on a local filesystem, root will mean the root of the filesystem.


#9

It’s possible I’m butchering the terminology, although what you said did result in me discovering something important.

When I say “host” what I’m actually doing is using the jekyll serve command and visiting the site at localhost:4000 in the tablet web browser, which I expect would interpret “/” as the root of the site. That said, what I discovered is that ‘jekyll serve’ doesn’t work on my laptop either. I hadn’t realized that, and after tinkering around I’ve managed to work out the following.

  1. The Github pages instructions state

    To create a User Pages site, name the repository using the naming scheme <username>.github.io.

    This isn’t actually needed, you can set it up in options. But it’s what I did.

  2. The baseurl in _config.yaml must match this repository name. Ex: /idtx314.github.io

  3. The url format for a github page is https://<username>.github.io/<repository_name>/
    Of course, this leads to doubling if you followed that naming instruction. Ex:
    https://idtx314.github.io/idtx314.github.io/

  4. At some point, while trying to make my url prettier, I set my baseurl to just “/”. I don’t really know why this worked, but it did, and my website url is:
    https://idtx314.github.io
    Only trouble (I’m aware of) is that doing this breaks jekyll serve.
    And so we have discovered the manner in which I dug my own grave.

I’ve sent that url out with job applications. So for the moment, I’ll “solve” the problem by just modifying the baseurl whenever I update the tablet’s copy of the repository and never push those changes. Later, maybe I can use a custom domain to redirect traffic from the older address.

Thank you for being around to offer expertise! You made this process a lot easier.


#10

GitHub Pages will also work if you don’t configure baseurl at all (i.e. baseurl is nil)


#11

Tried removing baseurl entirely. The whole thing is working normally with both jekyll serve and github pages and the url is short and sweet as well.

Reading up on what baseurl actually is, I see why the repo that I forked to use this template was using it, but it shouldn’t be necessary for my purposes.

Thanks again!


#12

7j

I’m attempting to localhost a website on my Android table

For debugging purpose, you can display your jekyll site on your tablet/phone by running bundle exec jekyll serve --host 0.0.0.0.