Giter Club home page Giter Club logo

Comments (8)

ashmaroli avatar ashmaroli commented on June 2, 2024

@dleidert How did you install jekyll.. or Ruby itself for that matter?
By default, the jekyll draft command is shipped via the jekyll-compose plugin. But in your case, the code has been packaged as though it were a part of the Jekyll core..

You'll have to uninstall the vendor gems and re-install to resolve this. To test if your Ruby installation is capable of reinstalling jekyll, first run the following:

gem install ffi sassc

If the above completes successfully, you're set to proceed with uninstalling jekyll. Otherwise, you may refer https://jekyllrb.com/docs/installation/ for instructions for your OS.


First try uninstalling existing Jekyll installation (which is inside /usr/lib/ruby/vendor_ruby/ as seen in the opening post) by running the following:

gem uninstall jekyll

or the following if there are permission issues:

sudo gem uninstall jekyll

If that fails, you can manually delete jekyll files and folders from /usr/lib/ruby/vendor_ruby/. Since I don't know the contents of your vendor_ruby directory, I can't reliably tell you if anything else needs to be deleted from there.


After uninstalling / deleting manually, re-install the core gem by running:

gem install jekyll --version 3.8.6

If running jekyll help now outputs without errors, you can proceed to install the plugin:

gem install jekyll-compose

from jekyll-compose.

dleidert avatar dleidert commented on June 2, 2024

Hi, I'm using the Debian packages for that matter which install the files into /usr/lib/ruby/vendor-ruby. Because the plugin ships the commands in lib//jekjyll/commands, they end up in /usr/lib/ruby/vendor-ruby/jekyll/commands/. This is the expected behaviour. I would consider it a bug if the plugin fails to work in this environment.

Adding a require 'jekyll-compose' on top of the files seems to fix the issue. This seems like a clean solution, no?

PS: I'm not willing to uninstall all packages to use an environment created by gem/bundler only just to use this plugin, because this will remove not just the ruby* packages from my system but also all packages depending on them. Installing just jekyll-compose as gem and using the system libraries does not work. jekyll help doesn't show any output at all in this case. I'm not sure why this is. Usually this works great.

from jekyll-compose.

ashmaroli avatar ashmaroli commented on June 2, 2024

@dleidert How Jekyll Plugin system works is very simple:
Jekyll calls the entry-file of the plugin / gem to be loaded. By convention, it is identical to the gem-name.

So in normal circumstances, when Jekyll Core calls for jekyll-compose plugin to be loaded, it dispatches a require 'jekyll-compose' call to Ruby which executes lib/jekyll-compose.rb which causes the listed *.rb within the gem to be loaded into memory.

The reason Debian package is failing is because jekyll/commands/draft.rb is being loaded without having the entry file (lib/jekyll-compose.rb) loaded first.
I would say that this is instead a bug in the Debian package.

Besides, I did not ask you to delete all packages just jekyll and associated plugins. If you're not willing to remove even those, I don't have an alternative suggestion.
Either ways, we wont be adding redundant require calls at the top of each command file just to work with an unrecommended approach.
Sorry.

from jekyll-compose.

dleidert avatar dleidert commented on June 2, 2024

There are a lot of plugins which extend Jekyll functionality and add commands (jekyll-watch) or converters (jekyll-sass-converter, jekyll-coffeescript). They all work without exception. Just jekyll-compose does not. I really don't think, this is a downstream issue.

The reason Debian package is failing is because jekyll/commands/draft.rb is being loaded without
having the entry file (lib/jekyll-compose.rb) loaded first.
I would say that this is instead a bug in the Debian package.

Why? I haven't changed the codebase even a bit. The vendor layout works for all other packages. I really fail to understand, what approach you are suggesting and what you think I have done wrong.

If you're not willing to remove even those, I don't have an alternative suggestion.

Please take a (large) step back. I'm using jekyll in a production environment. I cannot simply remove everything just for debugging purposes. And JFTR: All ruby* packages work except for this one. So there is a chance that you are actually doing something different or unexpected. Maybe you can give it a thought.

I will test things later in a chrooted environment and I'll talk to some of my fellow colleagues. Maybe they can help to sort this out.

from jekyll-compose.

dleidert avatar dleidert commented on June 2, 2024

I've tested in a clean chroot. I've used this Gemfile:

source "https://rubygems.org"
ruby RUBY_VERSION

gem "jekyll", "~> 3.7"
gem "jekyll-compose"

and

$ bundle install
$ bundle exec jekyll help

The new commands don't even show up.

$ bundle exec jekyll help
jekyll 3.8.6 -- Jekyll is a blog-aware, static site generator in Ruby

Usage:

  jekyll <subcommand> [options]

Options:
        -s, --source [DIR]  Source directory (defaults to ./)
        -d, --destination [DIR]  Destination directory (defaults to ./_site)
            --safe         Safe mode (defaults to false)
        -p, --plugins PLUGINS_DIR1[,PLUGINS_DIR2[,...]]  Plugins directory (defaults to ./_plugins)
            --layouts DIR  Layouts directory (defaults to ./_layouts)
            --profile      Generate a Liquid rendering profile
        -h, --help         Show this message
        -v, --version      Print the name and version
        -t, --trace        Show the full backtrace when an error occurs

Subcommands:
  docs                  
  import                
  build, b              Build your site
  clean                 Clean the site (removes site output and metadata file) without building.
  doctor, hyde          Search site and print specific deprecation warnings
  help                  Show the help message, optionally for a given subcommand.
  new                   Creates a new Jekyll site scaffold in PATH
  new-theme             Creates a new Jekyll theme scaffold
  serve, server, s      Serve your site locally 

I even tried adding a _config.yml with this content:

plugins:
  - jekyll-compose

It did not change anything. In the environment created with bundler, the new options don't show up at all.

from jekyll-compose.

ashmaroli avatar ashmaroli commented on June 2, 2024

For Jekyll 3.x, jekyll-compose is a regular non-blessed plugin. You have to include it in the :jekyll_plugins group in the Gemfile. From Jekyll 4.0 onwards, it'll be loaded automatically. The following is all that is required in a Bundler context. (No need of config file listing)

source "https://rubygems.org"

gem "jekyll", "~> 3.7"

group :jekyll_plugins do
  gem "jekyll-compose"
end
source "https://rubygems.org"

gem "jekyll", "~> 4.0"
gem "jekyll-compose"

from jekyll-compose.

ashmaroli avatar ashmaroli commented on June 2, 2024

Regarding the actual issue discussed in this ticket, if you or your colleagues are able to submit a Pull Request, I'll gladly look into it.

from jekyll-compose.

dleidert avatar dleidert commented on June 2, 2024

@ashmaroli Hi Ashwin, I was able to fix my issue using a different downstream packaging layout. Closing this issue. Thanks for your input.

from jekyll-compose.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.