Search code examples
rubygemsjekyllbundlerazure-pipelinesazure-pipelines-build-task

VSTS Build Pipeline: Bundle install task fails


I'm completely new to VSTS and its release/build pipelines. I've been following a guide to have VSTS automatically build and deploy my Jekyll site.

The task fails at the bundle install task:

2018-08-20T02:27:17.2704401Z ##[section]Starting: install dependencies 2018-08-20T02:27:17.2708156Z ============================================================================== 2018-08-20T02:27:17.2708277Z Task : Command Line 2018-08-20T02:27:17.2708381Z Description : Run a command line script using cmd.exe on Windows and bash on macOS and Linux. 2018-08-20T02:27:17.2708506Z Version : 2.136.0 2018-08-20T02:27:17.2708613Z Author : Microsoft Corporation 2018-08-20T02:27:17.2708768Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613735) 2018-08-20T02:27:17.2709048Z ============================================================================== 2018-08-20T02:27:18.1102116Z Generating script. 2018-08-20T02:27:18.1226372Z Script contents: 2018-08-20T02:27:18.1233486Z bundle install 2018-08-20T02:27:18.1838042Z ##[command]"C:\Windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "D:\a\_temp\c2eb18cb-eb2c-459b-8326-58392f545780.cmd"" 2018-08-20T02:27:20.5785853Z Ignoring eventmachine-1.2.7 because its extensions are not built. Try: gem pristine eventmachine --version 1.2.7 2018-08-20T02:27:20.5797913Z Ignoring ffi-1.9.25 because its extensions are not built. Try: gem pristine ffi --version 1.9.25 2018-08-20T02:27:20.5811063Z Ignoring http_parser.rb-0.6.0 because its extensions are not built. Try: gem pristine http_parser.rb --version 0.6.0 2018-08-20T02:27:25.7142354Z Fetching gem metadata from https://rubygems.org/........... 2018-08-20T02:27:25.8600906Z Fetching gem metadata from https://rubygems.org/. 2018-08-20T02:27:25.8867390Z Resolving dependencies... 2018-08-20T02:27:25.9863074Z Using public_suffix 3.0.2 2018-08-20T02:27:25.9866608Z Using addressable 2.5.2 2018-08-20T02:27:25.9869556Z Using bundler 1.16.3 2018-08-20T02:27:25.9873954Z Using colorator 1.1.0 2018-08-20T02:27:25.9877018Z Using concurrent-ruby 1.0.5 2018-08-20T02:27:25.9891240Z Fetching eventmachine 1.2.7 (x64-mingw32) 2018-08-20T02:27:26.5498918Z Installing eventmachine 1.2.7 (x64-mingw32) 2018-08-20T02:27:27.3971722Z Fetching http_parser.rb 0.6.0 2018-08-20T02:27:27.4135508Z Installing http_parser.rb 0.6.0 with native extensions 2018-08-20T02:27:39.0706988Z Gem::Ext::BuildError: ERROR: Failed to build gem native extension. 2018-08-20T02:27:39.0707433Z 2018-08-20T02:27:39.0707643Z current directory: D:/a/r1/a/_Experience 2018-08-20T02:27:39.0707862Z Guide/vendor/bundle/ruby/2.5.0/gems/http_parser.rb-0.6.0/ext/ruby_http_parser 2018-08-20T02:27:39.0708061Z C:/hostedtoolcache/windows/Ruby/2.5.0/x64/bin/ruby.exe -r 2018-08-20T02:27:39.0708210Z ./siteconf20180820-2744-iqcsgd.rb extconf.rb 2018-08-20T02:27:39.0708346Z creating Makefile 2018-08-20T02:27:39.0708451Z 2018-08-20T02:27:39.0708773Z current directory: D:/a/r1/a/_Experience 2018-08-20T02:27:39.0708924Z Guide/vendor/bundle/ruby/2.5.0/gems/http_parser.rb-0.6.0/ext/ruby_http_parser 2018-08-20T02:27:39.0709065Z make "DESTDIR=" clean 2018-08-20T02:27:39.0709181Z 2018-08-20T02:27:39.0709314Z current directory: D:/a/r1/a/_Experience 2018-08-20T02:27:39.0709474Z Guide/vendor/bundle/ruby/2.5.0/gems/http_parser.rb-0.6.0/ext/ruby_http_parser 2018-08-20T02:27:39.0709611Z make "DESTDIR=" 2018-08-20T02:27:39.0709769Z generating ruby_http_parser-x64-mingw32.def 2018-08-20T02:27:39.0709902Z compiling ruby_http_parser.c 2018-08-20T02:27:39.0710044Z x86_64-w64-mingw32-gcc.exe: error: 2018-08-20T02:27:39.0710242Z Guide/vendor/bundle/ruby/2.5.0/gems/http_parser.rb-0.6.0/ext/ruby_http_parser: 2018-08-20T02:27:39.0710383Z No such file or directory 2018-08-20T02:27:39.0710519Z make: *** [Makefile:242: ruby_http_parser.o] Error 1 2018-08-20T02:27:39.0710625Z 2018-08-20T02:27:39.0710769Z make failed, exit code 2 2018-08-20T02:27:39.0710869Z 2018-08-20T02:27:39.0711005Z Gem files will remain installed in D:/a/r1/a/_Experience 2018-08-20T02:27:39.0711176Z Guide/vendor/bundle/ruby/2.5.0/gems/http_parser.rb-0.6.0 for inspection. 2018-08-20T02:27:39.0711322Z Results logged to D:/a/r1/a/_Experience 2018-08-20T02:27:39.0711507Z Guide/vendor/bundle/ruby/2.5.0/extensions/x64-mingw32/2.5.0/http_parser.rb-0.6.0/gem_make.out 2018-08-20T02:27:39.0712572Z 2018-08-20T02:27:39.0712723Z An error occurred while installing http_parser.rb (0.6.0), and Bundler cannot 2018-08-20T02:27:39.0712863Z continue. 2018-08-20T02:27:39.0713000Z Make sure that `gem install http_parser.rb -v '0.6.0' --source 2018-08-20T02:27:39.0713187Z 'https://rubygems.org/'` succeeds before bundling. 2018-08-20T02:27:39.0713294Z 2018-08-20T02:27:39.0713415Z In Gemfile: 2018-08-20T02:27:39.0713579Z jekyll was resolved to 3.8.3, which depends on 2018-08-20T02:27:39.0713724Z em-websocket was resolved to 0.5.1, which depends on 2018-08-20T02:27:39.0713854Z http_parser.rb 2018-08-20T02:27:39.4215782Z ##[error]Cmd.exe exited with code '5'. 2018-08-20T02:27:39.4727933Z ##[section]Finishing: install dependencies

Here's my build pipeline:

  1. [use VSTS git as artifact]
  2. Use Ruby >= 2.4
  3. gem install bundler
  4. bundle install
  5. bundle exec jekyll build -d $(Build.ArtifactStagingDirectory)
  6. [publish site to artifacts]

I'm specifying a working directory under Advanced on all tasks as it was failing saying "No Gemfile found" before I did that.


Solution

  • This was caused by incorrectly having my .bundle directory checked in to the repository.

    More info: https://bundler.io/v1.3/rationale.html#checking-your-code-into-version-control