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

Getting "Error: No such file or directory" after including codefence. #9

Closed
jan0sch opened this issue May 29, 2015 · 10 comments
Closed

Comments

@jan0sch
Copy link

jan0sch commented May 29, 2015

Hi,

I followed the installation instructions and included the gem in my Gemfile and added the line - octopress-codefence to the gems: part in _config.yml. But after running bundle install jekyll refuses to start:

% bundle exec jekyll s
Configuration file: /PATH/_config.yml
            Source: /PATH
       Destination: /PATH/_site
      Generating... 
jekyll 2.5.3 | Error:  No such file or directory

If I remove the gem everything works. But I would really like to have code highlighting. ;-)

% uname -a
FreeBSD thor.rostock.home 10.1-RELEASE-p10 FreeBSD 10.1-RELEASE-p10 #0: Wed May 13 06:54:13 UTC 2015     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
% ruby -v
ruby 2.1.6p336 (2015-04-13 revision 50298) [amd64-freebsd10]

Any ideas?

@parkr
Copy link
Member

parkr commented May 29, 2015

Maybe it's Octopress Docs-related? https://github.com/octopress/codefence/blob/master/lib/octopress-codefence.rb#L115

Can you re-run Jekyll with --trace and see if you get a line number?

Jekyll has some code highlighting built in, remember. :)

@jan0sch
Copy link
Author

jan0sch commented May 29, 2015

Ok, here is the stracktrace:

/usr/local/lib/ruby/2.1/find.rb:42:in `block in find': No such file or directory (Errno::ENOENT)
        from /usr/local/lib/ruby/2.1/find.rb:42:in `collect!'
        from /usr/local/lib/ruby/2.1/find.rb:42:in `find'
        from /usr/local/lib/ruby/gems/2.1/gems/octopress-code-highlighter-4.2.4/lib/octopress-code-highlighter/cache.rb:41:in `each'
        from /usr/local/lib/ruby/gems/2.1/gems/octopress-code-highlighter-4.2.4/lib/octopress-code-highlighter/cache.rb:41:in `to_a'
        from /usr/local/lib/ruby/gems/2.1/gems/octopress-code-highlighter-4.2.4/lib/octopress-code-highlighter/cache.rb:41:in `clean'
        from /usr/local/lib/ruby/gems/2.1/gems/octopress-code-highlighter-4.2.4/lib/octopress-code-highlighter/hooks.rb:13:in `post_write'
        from /usr/local/lib/ruby/gems/2.1/gems/octopress-hooks-2.6.1/lib/octopress-hooks.rb:223:in `block in write'
        from /usr/local/lib/ruby/gems/2.1/gems/octopress-hooks-2.6.1/lib/octopress-hooks.rb:222:in `each'
        from /usr/local/lib/ruby/gems/2.1/gems/octopress-hooks-2.6.1/lib/octopress-hooks.rb:222:in `write'
        from /usr/local/lib/ruby/gems/2.1/gems/jekyll-2.5.3/lib/jekyll/site.rb:53:in `process'
        from /usr/local/lib/ruby/gems/2.1/gems/jekyll-2.5.3/lib/jekyll/command.rb:28:in `process_site'
        from /usr/local/lib/ruby/gems/2.1/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:56:in `build'
        from /usr/local/lib/ruby/gems/2.1/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:34:in `process'
        from /usr/local/lib/ruby/gems/2.1/gems/jekyll-2.5.3/lib/jekyll/commands/serve.rb:26:in `block (2 levels) in init_with_program'
        from /usr/local/lib/ruby/gems/2.1/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `call'
        from /usr/local/lib/ruby/gems/2.1/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `block in execute'
        from /usr/local/lib/ruby/gems/2.1/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `each'
        from /usr/local/lib/ruby/gems/2.1/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `execute'
        from /usr/local/lib/ruby/gems/2.1/gems/mercenary-0.3.5/lib/mercenary/program.rb:42:in `go'
        from /usr/local/lib/ruby/gems/2.1/gems/mercenary-0.3.5/lib/mercenary.rb:19:in `program'
        from /usr/local/lib/ruby/gems/2.1/gems/jekyll-2.5.3/bin/jekyll:20:in `<top (required)>'
        from /usr/local/bin/jekyll:23:in `load'
        from /usr/local/bin/jekyll:23:in `<main>'

The code seems to be:

      def clean
        remove = Find.find(CODE_CACHE_DIR).to_a.reject do |file|
          @cached_files.include?(file) || File.directory?(file)
        end

        @cached_files = []

        FileUtils.rm remove
      end

@imathis
Copy link
Member

imathis commented May 29, 2015

Thanks for posting the stack trace. I think this has something to do with the caching. I'll have a look.

@imathis
Copy link
Member

imathis commented May 29, 2015

I believe I've fixed this in version 4.2.5 of octopress-code-highlighter. If you update that gem, you should be good to go. Let me know if there's still any trouble.

@jan0sch
Copy link
Author

jan0sch commented May 29, 2015

No luck here. 😢 After running bundle update an bundle exec jekyll s --trace produces the following stacktrace:

/usr/local/lib/ruby/2.1/find.rb:42:in `block in find': No such file or directory (Errno::ENOENT)
    from /usr/local/lib/ruby/2.1/find.rb:42:in `collect!'
    from /usr/local/lib/ruby/2.1/find.rb:42:in `find'
    from /usr/local/lib/ruby/gems/2.1/gems/octopress-code-highlighter-4.2.5/lib/octopress-code-highlighter/cache.rb:43:in `each'
    from /usr/local/lib/ruby/gems/2.1/gems/octopress-code-highlighter-4.2.5/lib/octopress-code-highlighter/cache.rb:43:in `clean'
    from /usr/local/lib/ruby/gems/2.1/gems/octopress-code-highlighter-4.2.5/lib/octopress-code-highlighter/hooks.rb:13:in `post_write'
    from /usr/local/lib/ruby/gems/2.1/gems/octopress-hooks-2.6.1/lib/octopress-hooks.rb:223:in `block in write'
    from /usr/local/lib/ruby/gems/2.1/gems/octopress-hooks-2.6.1/lib/octopress-hooks.rb:222:in `each'
    from /usr/local/lib/ruby/gems/2.1/gems/octopress-hooks-2.6.1/lib/octopress-hooks.rb:222:in `write'
    from /usr/local/lib/ruby/gems/2.1/gems/jekyll-2.5.3/lib/jekyll/site.rb:53:in `process'
    from /usr/local/lib/ruby/gems/2.1/gems/jekyll-2.5.3/lib/jekyll/command.rb:28:in `process_site'
    from /usr/local/lib/ruby/gems/2.1/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:56:in `build'
    from /usr/local/lib/ruby/gems/2.1/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:34:in `process'
    from /usr/local/lib/ruby/gems/2.1/gems/jekyll-2.5.3/lib/jekyll/commands/serve.rb:26:in `block (2 levels) in init_with_program'
    from /usr/local/lib/ruby/gems/2.1/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `call'
    from /usr/local/lib/ruby/gems/2.1/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `block in execute'
    from /usr/local/lib/ruby/gems/2.1/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `each'
    from /usr/local/lib/ruby/gems/2.1/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `execute'
    from /usr/local/lib/ruby/gems/2.1/gems/mercenary-0.3.5/lib/mercenary/program.rb:42:in `go'
    from /usr/local/lib/ruby/gems/2.1/gems/mercenary-0.3.5/lib/mercenary.rb:19:in `program'
    from /usr/local/lib/ruby/gems/2.1/gems/jekyll-2.5.3/bin/jekyll:20:in `<top (required)>'
    from /usr/local/bin/jekyll:23:in `load'
    from /usr/local/bin/jekyll:23:in `<main>'

@parkr
Copy link
Member

parkr commented May 29, 2015

@imathis
Copy link
Member

imathis commented May 29, 2015

Grr. I guess I mistakenly expected Find to handle the enumerator that it returns properly. I'll add an exist? check. Like an animal.

@imathis
Copy link
Member

imathis commented May 29, 2015

Ok, update again. This should work. Sorry for the runaround.

@jan0sch
Copy link
Author

jan0sch commented May 29, 2015

Works like a charm. Thanks for the fast fix.

The new octopress rocks by the way. 👍

@imathis
Copy link
Member

imathis commented May 29, 2015

Sweet. Thanks! ⚡ 🎸 ⚡

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