Comments (8)
@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.
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.
@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.
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.
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.
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.
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.
@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)
- Default to listing available drafts HOT 1
- Using templates for new posts HOT 1
- Does not handle category subdirs correctly HOT 2
- Time for a new release HOT 1
- Allow to omit the layout HOT 2
- Time for a new release HOT 1
- Time for a new release HOT 1
- post to subfolder HOT 1
- Time for a new release HOT 1
- Time for a new release HOT 1
- `Tried to load unspecified class: Time` when running jekyll unpublish HOT 12
- Time for a new release HOT 1
- Time for a new release HOT 1
- Windows 11 : auto_open : true broken when file path has spaces HOT 1
- Time for a new release HOT 1
- Time for a new release HOT 1
- VCS-aware compose commands HOT 1
- Time for a new release HOT 1
- Editor opening issue HOT 1
- Time for a new release
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jekyll-compose.