Skip to content

Commit

Permalink
Fix jruby build (#467)
Browse files Browse the repository at this point in the history
* Use older version of bundler for jruby builds

The jruby build started failing when Travis started using bundler
version 1.14.3. It all worked on 1.13.7 so I'm switching back to that
version when a jruby build is detected.

[1] https://travis-ci.org/brigade/overcommit/jobs/194979683
[2] https://travis-ci.org/brigade/overcommit/jobs/189188271

* Pre-install rainbow to work around bundler issues on jruby

Installing rainbow manually before doing bundle install helped fix the
build locally for me.

* Apply workaround for failing rainbow install

I think I've found an issue describing the issues we've seen with the
jruby build:
ku1ik/rainbow#48

A workaround that people have applied is to run `gem update --system` as
a before_install hook. I'm giving that a try.

* Only apply gem update workaround for jruby

The workaround added in the previous commit seems to be working, but
only for the jruby build. We can conditionally apply it to prevent
failing builds for other ruby versions.
  • Loading branch information
MegaDev007 committed Feb 1, 2017
1 parent 49ddb3c commit 373005c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ before_script:
- git config --global user.email "[email protected]"
- git config --global user.name "Travis CI"

before_install:
- '[[ $TRAVIS_RUBY_VERSION =~ ^jruby ]] && gem update --system || true'

script:
- bundle exec rspec
# Skip Overcommit on JRuby since it's unstable and doesn't actually test Overcommit
Expand Down

0 comments on commit 373005c

Please sign in to comment.