-
Notifications
You must be signed in to change notification settings - Fork 3
Figure out Travis CI failures #16
Comments
The remedy per 18F/team-api.18f.gov#194 appears to be adding this to before_install:
- export GEM_HOME=$PWD/vendor/bundle/ruby/2.2.0
- gem install bundler |
😒 |
Actually, @jcscottiii figured out in 18F/knowledge-sharing-toolkit#3 that this is actually all that's needed: install:
- echo "no install steps needed" |
I understand why this is happening now (thanks to my work on 18F/knowledge-sharing-toolkit, where I hit the same issue trying to Dockerize 18F/team-api-server). When the system invokes ---
BUNDLE_PATH: vendor/bundle
BUNDLE_DISABLE_SHARED_GEMS: '1' When JEKYLL_BUILD_CMD = 'bundle exec jekyll build --trace' So when executing the team-api@e094cab62656:/usr/local/18f/team-api/team-api.18f.gov$ ./go build
Building internal version...
/usr/local/18f/rbenv/versions/2.3.0/lib/ruby/2.3.0/rubygems/dependency.rb:319:in `to_specs': Could not find 'bundler' (>= 0.a) among 46 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/usr/local/18f/team-api/team-api.18f.gov/vendor/bundle/ruby/2.3.0', execute `gem env` for more information
from /usr/local/18f/rbenv/versions/2.3.0/lib/ruby/2.3.0/rubygems/dependency.rb:328:in `to_spec'
from /usr/local/18f/rbenv/versions/2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_gem.rb:65:in `gem'
from /usr/local/18f/rbenv/versions/2.3.0/bin/bundle:22:in `<main>' we can see that gem 'bundler', version There are two workarounds. One, set The "real" solution, however, is to make |
Or, we can remove the |
Per #16, Travis started generating these.
See #16 for details. Basically, since the `./go` script should already invoke `require 'bundler/setup'`, running Jekyll with `bundle exec` proves unnecessary. The test_bundler_with_path_argument test case recreates the original failure faithfully, and validates the fix.
Closes #16. This change now ensures that _only_ the RUBYOPT variable gets filtered out of the child process environment (as introduced in #10). Most of the files here are for the new Jekyll test site, cribbed from the jekyll_pages_api_search gem tests, but with the jekyll_pages_api_search components stripped out. Removing `bundle exec` from JEKYLL_BUILD_CMD in #17 meant that BUNDLE_BIN_PATH and BUNDLE_GEMFILE weren't set for the Jekyll child process. Therefore, when Jekyll tried to load a gem from the :jekyll_plugins group, it couldn't find it. From https://travis-ci.org/18F/before-you-ship/builds/112281551: 1.22s$ ./go ci_test /home/travis/.rvm/gems/ruby-2.2.4@global/gems/bundler-1.11.2/lib/bundler/runtime.rb:80:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'guides_style_18f'. (Bundler::GemRequireError) from /home/travis/.rvm/gems/ruby-2.2.4@global/gems/bundler-1.11.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require' from /home/travis/.rvm/gems/ruby-2.2.4@global/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each' from /home/travis/.rvm/gems/ruby-2.2.4@global/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require' from /home/travis/.rvm/gems/ruby-2.2.4@global/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each' from /home/travis/.rvm/gems/ruby-2.2.4@global/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require' from /home/travis/.rvm/gems/ruby-2.2.4@global/gems/bundler-1.11.2/lib/bundler.rb:99:in `require' from /home/travis/build/18F/before-you-ship/vendor/bundle/ruby/2.2.0/gems/jekyll-3.1.2/lib/jekyll/plugin_manager.rb:34:in `require_from_bundler' from /home/travis/build/18F/before-you-ship/vendor/bundle/ruby/2.2.0/gems/jekyll-3.1.2/bin/jekyll:9:in `<top (required)>' from /home/travis/build/18F/before-you-ship/vendor/bundle/ruby/2.2.0/bin/jekyll:23:in `load' from /home/travis/build/18F/before-you-ship/vendor/bundle/ruby/2.2.0/bin/jekyll:23:in `<main>' The tests added in #17 didn't catch this because they only tried to execute the `./go` script rather than build a Jekyll site containing a plugin. The updated tests, which now build a Jekyll site with the guides_style_18f plugin, both reproduce the above error and verify its fix.
Turns out #17 introduced a new issue, and not just a Travis issue, but a general Jekyll build issue. #18 is now out to resolve this issue. Removing
The tests added in #17 didn't catch this because they only tried to execute the |
Travis has started throwing errors for
./go build
:https://travis-ci.org/18F/web-design-standards/builds/106562512
https://travis-ci.org/18F/web-design-standards/builds/106737058#L247
travis-ci/travis-ci#4536 references this problem, which I think has to do with the
--path
argument andbundler
itself not being in theBUNDLER_PATH
.Also: https://docs.travis-ci.com/user/caching/#Bundler
cc: @juliaelman @harrisj @afeld @rogeruiz
The text was updated successfully, but these errors were encountered: