Home > Software engineering >  Jekyll serve doesn't work, Permission denied
Jekyll serve doesn't work, Permission denied

Time:10-24

I downloaded ruby and Jekyll as a gem on a windows machine, now I want to test a site I made, but the Jekyll server opens, and then closes, does anyone has any clue on what I can do to fix this issue. thank you!!

Here is the error

> C:\Users\30697\Downloads
λ jekyll serve
Configuration file: none
            Source: C:/Users/30697/Downloads
       Destination: C:/Users/30697/Downloads/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
                    ------------------------------------------------
      Jekyll 4.2.1   Please append `--trace` to the `serve` command
                     for any additional information or backtrace.
                    ------------------------------------------------
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/utils.rb:141:in `initialize': Permission denied @ rb_sysopen - C:/Users/30697/Downloads/FirefoxPortable/Data/profile/parent.lock (Errno::EACCES)
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/utils.rb:141:in `open'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/utils.rb:141:in `has_yaml_header?'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:52:in `block in read_directories'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:48:in `each'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:48:in `read_directories'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:89:in `block in retrieve_dirs'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:86:in `each'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:86:in `retrieve_dirs'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:60:in `read_directories'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:89:in `block in retrieve_dirs'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:86:in `each'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:86:in `retrieve_dirs'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:60:in `read_directories'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:89:in `block in retrieve_dirs'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:86:in `each'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:86:in `retrieve_dirs'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:60:in `read_directories'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:16:in `read'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/site.rb:181:in `read'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/site.rb:78:in `process'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/command.rb:28:in `process_site'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/commands/build.rb:65:in `build'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/commands/build.rb:36:in `process'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `each'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/exe/jekyll:15:in `<top (required)>'
        from C:/Ruby30-x64/bin/jekyll:25:in `load'
        from C:/Ruby30-x64/bin/jekyll:25:in `<main>'

C:\Users\30697\Downloads

CodePudding user response:

You are running jekyll serve in the root folder of Downloads. Jekyll will process every subfolder in that folder, which can be anything you have sitting there. Things which probably have nothing to do with Jekyll. This will confuse Jekyll.

To fix this create a subfolder for your Jekyll project, and then run jekyll serve from there.

Example:

> jekyll new mysite
> cd mysite           <-- very important!!!
> jekyll serve
  • Related