gems installed by rake cannot find json dependency
The two gems that we keep gemfiles for, danger
and fpm
, cannot find its json
dependency. Here it is for fpm
:
$ rake build:agent_pkg
/home/andrei/work/isc/stork/tools/ruby/bin/bundle install --gemfile /home/andrei/work/isc/stork/rakelib/init_deps/fpm/Gemfile --path /home/andrei/work/isc/stork/tools/ruby --binstubs /home/andrei/work/isc/stork/tools/ruby/bin_bundle
[DEPRECATED] The `--path` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local path '/home/andrei/work/isc/stork/tools/ruby'`, and stop using this flag
[DEPRECATED] The --binstubs option will be removed in favor of `bundle binstubs --all`
Using arr-pm 0.0.12
Using backports 3.24.1
Using bundler 2.3.26
Using cabin 0.9.0
Using clamp 1.0.1
Using dotenv 2.8.1
Using insist 1.0.0
Using mustache 0.99.8
Using stud 0.0.23
Using pleaserun 0.0.32
Using rexml 3.2.6
Using fpm 1.15.1
Bundle complete! 1 Gemfile dependency, 12 gems now installed.
Bundled gems are installed into `./tools/ruby`
/home/andrei/work/isc/stork/tools/ruby/bin_bundle/fpm --version
/home/andrei/work/isc/stork/tools/ruby/ruby/3.0.0/gems/fpm-1.15.1/lib/fpm/package/python.rb:8:in `require': cannot load such file -- json (LoadError)
from /home/andrei/work/isc/stork/tools/ruby/ruby/3.0.0/gems/fpm-1.15.1/lib/fpm/package/python.rb:8:in `<top (required)>'
from /home/andrei/work/isc/stork/tools/ruby/ruby/3.0.0/gems/fpm-1.15.1/lib/fpm.rb:14:in `require'
from /home/andrei/work/isc/stork/tools/ruby/ruby/3.0.0/gems/fpm-1.15.1/lib/fpm.rb:14:in `<top (required)>'
from /home/andrei/work/isc/stork/tools/ruby/ruby/3.0.0/gems/fpm-1.15.1/bin/fpm:4:in `require'
from /home/andrei/work/isc/stork/tools/ruby/ruby/3.0.0/gems/fpm-1.15.1/bin/fpm:4:in `<top (required)>'
from /home/andrei/work/isc/stork/tools/ruby/bin_bundle/fpm:27:in `load'
from /home/andrei/work/isc/stork/tools/ruby/bin_bundle/fpm:27:in `<main>'
rake aborted!
Command failed with status (1): [/home/andrei/work/isc/stork/tools/ruby/bin...]
/home/andrei/work/isc/stork/rakelib/00_init.rake:789:in `block in <top (required)>'
Tasks: TOP => build:agent_pkg => dist/pkgs/agent-built.pkg => /home/andrei/work/isc/stork/tools/ruby/bin_bundle/fpm
(See full trace by running task with --trace)
EXIT 1
Adding json
explicitly to the gemfiles solves the error.
diff --git a/rakelib/init_deps/danger/Gemfile b/rakelib/init_deps/danger/Gemfile
index ef891660..000d7a08 100644
--- a/rakelib/init_deps/danger/Gemfile
+++ b/rakelib/init_deps/danger/Gemfile
@@ -12 +12,2 @@ gem "danger-commit_lint"
+gem "json"
diff --git a/rakelib/init_deps/danger/Gemfile.lock b/rakelib/init_deps/danger/Gemfile.lock
index 38a96aee..1e0c28e2 100644
--- a/rakelib/init_deps/danger/Gemfile.lock
+++ b/rakelib/init_deps/danger/Gemfile.lock
@@ -48,2 +48,3 @@ GEM
multi_xml (>= 0.5.2)
+ json (2.7.1)
kramdown (2.4.0)
@@ -80,2 +81,3 @@ DEPENDENCIES
danger-gitlab
+ json
diff --git a/rakelib/init_deps/fpm/Gemfile b/rakelib/init_deps/fpm/Gemfile
index 0e00763b..8c37654b 100644
--- a/rakelib/init_deps/fpm/Gemfile
+++ b/rakelib/init_deps/fpm/Gemfile
@@ -7 +7,3 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
gem "fpm"
+
+gem "json"
diff --git a/rakelib/init_deps/fpm/Gemfile.lock b/rakelib/init_deps/fpm/Gemfile.lock
index 0087832b..88efa171 100644
--- a/rakelib/init_deps/fpm/Gemfile.lock
+++ b/rakelib/init_deps/fpm/Gemfile.lock
@@ -17,2 +17,3 @@ GEM
insist (1.0.0)
+ json (2.7.1)
mustache (0.99.8)
@@ -33,2 +34,3 @@ DEPENDENCIES
fpm
+ json