1

I am working on a jekyll site for my portfolio, using github, travis-ci.After a long time I wanted to change the content of my site. After making a commit to master branch triggered the build in travis but failed with same error. I tried changing versions of ruby versions but got no luck.

Error

 bundle install --jobs=3 --retry=3 --deployment --path=${BUNDLE_PATH:-vendor/bundle}
168/home/travis/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/rubygems.rb:289:in `find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException)
169 from /home/travis/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/rubygems.rb:308:in `activate_bin_path'
170 from /home/travis/.rvm/gems/ruby-2.5.1/bin/bundle:23:in `<main>'
171 from /home/travis/.rvm/gems/ruby-2.5.1/bin/ruby_executable_hooks:15:in `eval'
172 from /home/travis/.rvm/gems/ruby-2.5.1/bin/ruby_executable_hooks:15:in `<main>'
173
174

travis.yml

language: ruby
rvm:
  - 2.5.1

before_script:
- chmod +x ./script/cibuild

script: ./script/cibuild

cache: bundler

env:
   global:
   - NOKOGIRI_USE_SYSTEM_LIBRARIES=true

deploy:
  provider: surge
  skip_cleanup: true
  project: ./_site/
  domain: https://mysite.surge.sh
on:
  branch: master

  • 1
    None of those duplicate questions helped, but adding `dist: trusty` in .travis.yml sorted the issue. [refer](https://changelog.travis-ci.com/xenial-as-the-default-build-environment-99476). – Motheri Yani Sep 30 '19 at 08:36
  • Well, the source of your issue is indeed that the version of bundler for your ruby version doesn't match the one specified in your `Gemfile.lock` (most likely because on of those specified Bundler 2.x while the other uses Bundler 1.x) as explained in some of the answers to the duplicated questions. Thus, you can also fix this issue with other Ruby versions by installing your exact required version of bundler in an `install` hook in your `travis.yml`. – Holger Just Sep 30 '19 at 09:00

0 Answers0