Menu

#658 Ruby shows an error message "Undefined method `name'" when I try to generate a jekyll web-page

working markup
closed
None
5
2016-07-12
2016-07-11
No

My system gives the following message:

Andreis-iMac:github-pages-sandbox andrei$ jekyll build
Configuration file: /Users/andrei/GitHub/github-pages-sandbox/_config.yml
            Source: /Users/andrei/GitHub/github-pages-sandbox
       Destination: /Users/andrei/GitHub/github-pages-sandbox/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
jekyll 3.1.6 | Error:  undefined method `name' for #<Jekyll::Document:0x007ffd652a0a70>

More precisely, it does not like the following piece of code:

site.posts.docs.each do |post|
    if post.name.match(/\.wmd$/)
        convertPost post
    end
end

it's the lines No. 69-73 in wmd.rb of https://sourceforge.net/p/workingwiki/code/HEAD/tree/trunk/wmd/

Discussion

  • Andrei Akhmetzhanov

    PS: I changed posts.each to posts.docs.each since it was required by my version of Ruby

    Deprecation: posts.each should be changed to posts.docs.each.
     Called by /Users/andrei/GitHub/github-pages-sandbox/_plugins/wmd.rb:69:in `generate'.
    
     
  • Andrei Akhmetzhanov

    I can substitute post.name.match with post.basename.match, so that

    site.posts.docs.each do |post|
        if post.basename.match(/\.wmd$/)
            convertPost post
        end
    end
    

    Then I would need to use basename instead of name in convertPost-function below. But then I get another error

    jekyll 3.1.6 | Error:  undefined method `ext=' for #<Jekyll::Document:0x007f8bfc9558c8>
    

    Also, I've got another depreciation

    Deprecation: Document#slug is now a key in the #data hash.
    Called by /Users/andrei/GitHub/github-pages-sandbox/_plugins/wmd.rb:93:in `convertPost'.
    
     
  • Andrei Akhmetzhanov

    PS: I assume it's mainly b/c of a newer version of jekyll

     
  • Lee Worden

    Lee Worden - 2016-07-11

    I've been using it with Jekyll 2.5.3. I need to update.

     
  • Lee Worden

    Lee Worden - 2016-07-11

    Or actually I think I have it running with a more recent version of jekyll on our server at UCSF, but I don't have access to that today. Working on upgrading on ubuntu 14.04 (my laptop).

     
  • Lee Worden

    Lee Worden - 2016-07-11

    update: I have figured out how to install ruby-2.3.1 on ubuntu 14.04 and updated the installation instructions. It looks like it's generating the same error messages that you reported.

     
  • Lee Worden

    Lee Worden - 2016-07-11

    Am working on this error:

    jekyll 3.1.6 | Error:  undefined method `read_directories' for #<Jekyll::Site:0x002af5ce9a3e38>
    

    If read_directories is no longer there, I need to call something else to get it to include all project files that have been generated while processing into the jekyll site. That's never been a very good way of doing it anyway, because it gets out of sync when multiple pages alter the same project directory. I need to browse the new jekyll code and see how it scans directories for files.

     
  • Lee Worden

    Lee Worden - 2016-07-11

    All Ruby errors and deprecations seem to be fixed, but it looks like either Jekyll's internals have changed in some way or I've introduced a bug that stops it from doing the markdown processing correctly - though the WMD pre- and post-processing are fine - I'm working on it

     
  • Lee Worden

    Lee Worden - 2016-07-11

    wmd.rb looks to be running correctly on the github demo site. The demo site needs some updating, as the Sage libraries need a different installation procedure now. Also I want to test wmd.rb on a site that uses pages as well as posts.

     
  • Lee Worden

    Lee Worden - 2016-07-11

    OK. Seems to be good now. Now in the latest SVN trunk commit. I need to update the documentation and upload a new .tar.gz.

     
  • Lee Worden

    Lee Worden - 2016-07-12

    Closing. Ruby code updated, demo website updated, instructions updated, new tar file uploaded to source forge.

     
  • Lee Worden

    Lee Worden - 2016-07-12
    • status: open --> closed
    • assigned_to: Lee Worden
     
  • Lee Worden

    Lee Worden - 2016-07-12

    (though it looks like the mathml on the demo site might be a little off)

     

Anonymous
Anonymous

Add attachments
Cancel