Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jekyll crash on invalid path in configuration #8

Closed
MitMaro opened this issue Aug 23, 2014 · 2 comments
Closed

Jekyll crash on invalid path in configuration #8

MitMaro opened this issue Aug 23, 2014 · 2 comments

Comments

@MitMaro
Copy link

MitMaro commented Aug 23, 2014

I want to preface this with saying that I am not a Ruby developer but am willing to help in anyway I can. I am also not sure if the issue is with the paginate plugin or if it is Jekyll that should not crash because of the following report.


Issue description

Jekyll will crash when watching for changes given the following configuration when it tries to auto-regenerate provided there are at least two posts inside the _posts folder.

_config.yml
paginate: 1
paginate_path: ":path/page:num"
Terminal output
Configuration file: /Users/mitmaro/Code/tmp/website.jekyll/_config.yml
            Source: /Users/mitmaro/Code/tmp/website.jekyll
       Destination: /Users/mitmaro/Code/tmp/website.jekyll/_site
      Generating...
                    done.
 Auto-regeneration: enabled for '/Users/mitmaro/Code/tmp/website.jekyll'
      Regenerating: 1 files at 2014-08-22 23:48:14 ...done.
E, [2014-08-22T23:48:14.697565 #48565] ERROR -- : run() in thread failed: different prefix: "" and "/Users/mitmaro/Code/tmp/website.jekyll":/usr/local/Cellar/ruby/2.1.2_2/lib/ruby/2.1.0/pathname.rb:500:in `relative_path_from'
/usr/local/lib/ruby/gems/2.1.0/gems/listen-2.7.9/lib/listen/adapter/darwin.rb:29:in `block in _process_event'
/usr/local/lib/ruby/gems/2.1.0/gems/listen-2.7.9/lib/listen/adapter/darwin.rb:25:in `each'
/usr/local/lib/ruby/gems/2.1.0/gems/listen-2.7.9/lib/listen/adapter/darwin.rb:25:in `_process_event'
/usr/local/lib/ruby/gems/2.1.0/gems/listen-2.7.9/lib/listen/adapter/base.rb:47:in `block (2 levels) in configure'
/usr/local/lib/ruby/gems/2.1.0/gems/rb-fsevent-0.9.4/lib/rb-fsevent/fsevent.rb:45:in `call'
/usr/local/lib/ruby/gems/2.1.0/gems/rb-fsevent-0.9.4/lib/rb-fsevent/fsevent.rb:45:in `run'
/usr/local/lib/ruby/gems/2.1.0/gems/listen-2.7.9/lib/listen/adapter/darwin.rb:21:in `_run'
/usr/local/lib/ruby/gems/2.1.0/gems/listen-2.7.9/lib/listen/adapter/base.rb:58:in `block in start'

Steps to reproduce

Step 1

Create a basic Jekyll site using the following commands:

gist for script: https://gist.github.com/MitMaro/af4680417bb95761fd0c
mkdir website.jekyll
cd website.jekyll
mkdir _layouts _posts
touch _layouts/default.md
touch _posts/2000-01-01-title1.md _posts/2000-01-02-title2.md
cat > index.html << EOF

---
layout: default

---
EOF
cat > _config.yml << EOF
paginate: 1
paginate_path: ":path/page:num"
EOF

Step 2

Build the site with Jekyll using the watch setting: jekyll build --watch

Step 3

Touch the index.html file using touch index.html

What I have deduced

The problem is the line paginate_path: ":path/page:num" in the config file as it creates pages using :path (see tree output below) which I believe is what causing the crash. Changing the line to paginate_path: "blog/page:num" fixes the problem.

Tree output
$ tree
.
├── _config.yml
├── _layouts
│   └── default.md
├── _posts
│   ├── 2000-01-01-title1.md
│   └── 2000-01-02-title2.md
├── _site
│   ├── 2000
│   │   └── 01
│   │       ├── 01
│   │       │   └── title1.html
│   │       └── 02
│   │           └── title2.html
│   ├── :path
│   │   └── page2
│   │       └── index.html
│   └── index.html
└── index.html

Versions

System: Mac OSX 10.9.2
Ruby: ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
Jekyll: jekyll 2.3.0
Jekyll Paginate: 2.4.1

Conclusion

I am aware that using :path is not recommended or should be allowed given that : is generally used as a path separator on *nix systems. The reason for having :path for the paginate_path was that I had accidentally changed the wrong value in the config file. Given that the Jekyll error was almost entirely useless (at least to me) would it be possible to have either some check on the configuration variable, have it documented (perhaps this issue alone would be enough), or is this a problem with Jekyll and it should be addressed there?

@wisq
Copy link

wisq commented Jan 2, 2016

The problem is that rb-fsevent can't handle colons in directory names, because it uses that as a separator character. I discovered this because one of my topic tags had a colon in it, completely unrelated to jekyll-paginate.

I've filed issues with the relevant gems:

@parkr
Copy link
Member

parkr commented Jan 11, 2016

I don't believe :path is a valid permalink key. Only :num is valid: http://jekyllrb.com/docs/pagination/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants