Hi Daniel!
I can reproduce this locally, and without having a closer look, I agree
there's room for improvement in bundler here (maybe in jekyll too), at
least in terms of better error messages. Feel free to report the issue
upstream so it doesn't get lost.
To workaround the issue, you can run `bundle install` before running
jekyll so that version information for the new gems you added gets added
to the lockfile. Note that even if the particular gem does not get
installed on your system, it's still used for resolution so that users
of the app on other platforms get a consistent version of those
dependencies when using the application.
Best,
David.
El 25/4/20 a las 15:00, Daniel Leidert escribió:
Hi there,
there is something weird going on with bundler and I suspect a bug. Consider
this part of a Gemfile for a jekyll site:
install_if -> { RUBY_PLATFORM =~ /mingw|mswin|java/ } do
gem "wdm", "~> 0.1.0"
end
It ckearly states that the "wdm" gem is not required on my Debian linux. And
when I run `jekyll b` it is fine. Now if I add some gems here:
install_if -> { RUBY_PLATFORM =~ /mingw|mswin|java/ } do
gem "wdm", "~> 0.1.0"
gem "tzinfo", "~> 1.2"
gem "tzinfo-data"
end
and run `jekyll b` again there is a complaint:
/usr/lib/ruby/2.7.0/bundler/resolver.rb:290:in `block in
verify_gemfile_dependencies_are_found!': Could not find gem 'wdm (~> 0.1.0)' in
any of the gem sources listed in your Gemfile. (Bundler::GemNotFound)
Why is that? The gems shouldn't be required at all and bundler should not
behave differently if one or more gems are listed in the block, no?