Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"cannot load such file -- travis/support (LoadError)" when running "travis compile" #8098

Closed
styurin opened this issue Jul 16, 2017 · 27 comments

Comments

Projects
None yet
@styurin
Copy link

commented Jul 16, 2017

I'm trying to run travis compile in docker container.

I followed these instructions and I'm using quay.io/travisci/travis-android image:

$ sudo - travis
$ rvm install 2.3.0
$ rvm use 2.3.0
$ cd ~/builds
$ git clone https://github.com/travis-ci/travis-build.git
$ cd travis-build
$ gem install travis
$ travis
$ ln -s `pwd` ~/.travis/travis-build
$ bundle install
$ cd ~/builds
$ git clone https://github.com/facebook/buck.git
$ cd buck
$ travis compile
/home/travis/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require': cannot load such file -- travis/support (LoadError)
	from /home/travis/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require'
	from /home/travis/.travis/travis-build/lib/travis/build.rb:1:in `<top (required)>'
	from /home/travis/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require'
	from /home/travis/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require'
	from /home/travis/.travis/travis-build/init.rb:11:in `setup'
	from /home/travis/.rvm/gems/ruby-2.3.0/gems/travis-1.8.8/lib/travis/cli/command.rb:197:in `execute'
	from /home/travis/.rvm/gems/ruby-2.3.0/gems/travis-1.8.8/lib/travis/cli.rb:64:in `run'
	from /home/travis/.rvm/gems/ruby-2.3.0/gems/travis-1.8.8/bin/travis:18:in `<top (required)>'
	from /home/travis/.rvm/gems/ruby-2.3.0/bin/travis:23:in `load'
	from /home/travis/.rvm/gems/ruby-2.3.0/bin/travis:23:in `<main>'
	from /home/travis/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
	from /home/travis/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'
@egor7

This comment has been minimized.

Copy link

commented Jul 17, 2017

Have the same issue on arch linux

@CDJojn

This comment has been minimized.

Copy link

commented Jul 17, 2017

Totally this same issue, most probably according to same installation procedure.

@tadziopazur

This comment has been minimized.

Copy link

commented Jul 18, 2017

Same here.

@rplankenhorn

This comment has been minimized.

Copy link

commented Jul 19, 2017

Any word on this? I'm seeing this issue as well.

@BanzaiMan

This comment has been minimized.

Copy link
Member

commented Jul 19, 2017

My preliminary investigation shows that this has been broken since December last year.

While I continue investigating, I am curious to learn why there is a sudden surge in interest for this command.

What drove you to use it?

@rplankenhorn

This comment has been minimized.

Copy link

commented Jul 19, 2017

@BanzaiMan The project I am on is massive and it takes forever to build (30+ minutes). I am working through some build issues where I need to test frequently and it would be super beneficial if I could test locally instead of pushing up to a Github branch and waiting for the pull request to build.

@tadziopazur

This comment has been minimized.

Copy link

commented Jul 19, 2017

In my case we have a github project that we CI on Travis, and those tests are slow on cloud-hosted Travis.
Local builds (basically what Travis runs as payload of .travis.yml) are roughly order of magnitude faster.
Whole Travis CI cycle takes ~ half an hour. Think 10 seconds instead of a minute or two for simple check (plus the github push).

Shaving those minutes from development cycle is what I am after.

@javabudd

This comment has been minimized.

Copy link

commented Jul 22, 2017

Same issue here with a fresh build of the container and same instructions followed.

/home/travis/.rvm/gems/ruby-2.3.0/gems does not contain the travis_support library.

find /home/travis -name travis reveals the library in ./.rvm/gems/ruby-2.3.0/bundler/gems/travis-support-113cff17fe38

Linux ---- 4.9.32-15.41.amzn1.x86_64 #1 SMP Thu Jun 22 06:20:54 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

@styurin

This comment has been minimized.

Copy link
Author

commented Jul 27, 2017

Any updates on this? Is there another way to test changes in .travis.yml.

@Samweli

This comment has been minimized.

Copy link

commented Jul 30, 2017

I have the same issue, anyone who have the solution for this??

@jeevandev

This comment has been minimized.

Copy link

commented Aug 2, 2017

Same issue as well, we were trying to use this to run travis locally for debugging

@gseastream

This comment has been minimized.

Copy link

commented Aug 2, 2017

Looks like I am having this exact same issue as well. Is there a fix for it? Or some alternative until then?

@jpetazzo

This comment has been minimized.

Copy link

commented Aug 8, 2017

For what it's worth, here is a Dockerfile to reproduce the issue:

FROM quay.io/travisci/travis-android
USER travis
RUN bash -lc "rvm install 2.3.0"
RUN bash -lc "rvm use 2.3.0 --default"
WORKDIR /home/travis/builds
RUN git clone https://github.com/travis-ci/travis-build.git
WORKDIR travis-build
RUN bash -lc "gem install travis"
RUN bash -lc travis
RUN ln -s $(pwd) /home/travis/.travis/travis-build
RUN bash -lc "bundle install"
WORKDIR /home/travis/builds
RUN git clone https://github.com/facebook/buck.git
WORKDIR buck
RUN bash -lc "travis compile"
@imhomos

This comment has been minimized.

Copy link

commented Aug 8, 2017

#imhomos

@ryndaniels

This comment has been minimized.

Copy link

commented Aug 9, 2017

I've been able to reproduce this as well, and have a temporary workaround. The workaround was to clone travis-support and travis-rollout, and use gem build and gem install to install those two ruby gems. Once I did that I was able to successfully run travis compile. I believe this is due to the fact that when gems are installed from git with bundler, they're then available via bundler but not in your GEM_HOME, so since travis compile isn't run with bundler it doesn't know about those installations of the gems. I think this could be fixed for real by publishing these gems to rubygems.org, I'll look into doing that.

@jpetazzo

This comment has been minimized.

Copy link

commented Aug 9, 2017

Yes, I found the same result. I had a slightly different workaround:

  • after bundler install, do bundler add travis
  • then instead of travis compile, do bundler travis compile
  • run bundler binstubs travis (this creates bin/travis which can be used in lieu of travis)
  • symlink that stub to /usr/local/bin or wherever

Note that gem install travis is not necessary (and even harmful in that case) since it'll collide with the bundler binstub.

@ryndaniels

This comment has been minimized.

Copy link

commented Aug 9, 2017

@jpetazzo I actually like your idea better, as it will work regardless of any other github-installed dependencies that might get added to travis-build in the future. I haven't been able to reproduce what you described though, any chance you're able to create a Dockerfile or similar for that as well so I can verify? Thanks!

@soulshake

This comment has been minimized.

Copy link

commented Aug 9, 2017

@kdaniels try this Dockerfile (not the most efficient but gets the point across, I think):

FROM quay.io/travisci/travis-android
USER travis
RUN bash -lc "rvm install 2.3.0"
RUN bash -lc "rvm use 2.3.0 --default"
WORKDIR /home/travis/builds
RUN git clone https://github.com/travis-ci/travis-build.git
WORKDIR travis-build
RUN mkdir -p /home/travis/.travis
RUN ln -s $(pwd) /home/travis/.travis/travis-build
RUN bash -lc "bundle install"
RUN bash -lc "bundler add travis"
WORKDIR /home/travis/builds/travis-build

RUN bash -lc "bundler binstubs travis"

# Clone a random repo containing a .travis.yml
RUN git clone https://github.com/soulshake/startup-threads-cli.git
WORKDIR startup-threads-cli
CMD ["bash", "-l", "-c", "/home/travis/.travis/travis-build/bin/travis compile --no-interactive"]

docker build -ti compileissue
docker run -ti compileissue
... should spit out the contents of the resulting build.sh.

@ryndaniels

This comment has been minimized.

Copy link

commented Aug 10, 2017

Thanks @soulshake! I've opened a PR to update the documentation so hopefully this should be more clear going forward. In the meantime, other people having this issue should be able to get compile working by doing the following:

cd ~/.travis/travis-build/
bundle install
bundler add travis
bundler binstubs travis
cd <REPO_YOU_WANT_TO_RUN_COMPILE_IN>
~/.travis/travis-build/bin/travis compile
@BanzaiMan

This comment has been minimized.

Copy link
Member

commented Aug 15, 2017

We've merged @kdaniels's fix. Thanks.

@lv7777

This comment has been minimized.

Copy link

commented Apr 5, 2018

I dont avoid error neither @jpetazzo nor @ryndaniels workaronds.
I used ci-garnet:packer-1503972846
(i think this docker image is applyed patch,so i dont need workaround)
docker run -it -u travis quay.io/travisci/ci-garnet /bin/bash
and running this script
https://medium.com/google-developers/how-to-run-travisci-locally-on-docker-822fc6b2db2e

error is

travis@4f375fe8e1fa:~/builds/lv7777/ibus-mio$ travis compile
/home/travis/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/specification.rb:2278:in `check_version_conflict': can't activate addressable-2.4.0, already activated addressable-2.5.1 (Gem::LoadError)
	from /home/travis/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/specification.rb:1404:in `activate'
...etc

regards.

@ekivolowitz

This comment has been minimized.

Copy link

commented Jun 5, 2018

@lv7777
I'm pretty new to Travis, Docker, and Ruby, but I think that that means that you're using ruby 2.5.1. Try rerunning those commands without rvm install ruby-2.x.x and rvm use ruby-2.x.x. Maybe.

@satyamakgec

This comment has been minimized.

Copy link

commented Jun 21, 2018

After following up whole issue chain. when I am able to run ~/.travis/travis-build/bin/travis compile successfully, Now a new error pops out.

matrix key is ignored
echo -e ""
echo -e "There was an error in the .travis.yml file from which we could not recover.
"
echo -e "Unfortunately, we do not know much about this error."
echo -e ""
echo -e "Please review https://docs.travis-ci.com"

Is their any solution of this or how I can findout the root cause of it.
Below is my .travis.yml url

https://github.com/PolymathNetwork/polymath-core/blob/master/.travis.yml

@ekivolowitz

This comment has been minimized.

Copy link

commented Jun 21, 2018

@satyamakgec See my resolution here. Clone this branch and use it for travis-build. If you get the travis/support error like the original issue states, my solution @ryndaniels' solution was this.

In ~/.travis/

git clone https://github.com/travis-ci/travis-support.git
cd travis-support
gem build travis-support.gemspec # Or whatever the filename is, I'm doing this from memory
gem install travis-support

Likely if you get the travis-support error, you will get travis-rollout and travis-github_apps errors too. Just follow the same steps.

@satyamakgec

This comment has been minimized.

Copy link

commented Jun 25, 2018

@ekivolowitz nothing worked I tried

@ekivolowitz

This comment has been minimized.

Copy link

commented Jun 25, 2018

@satyamakgec My travis compile environment works. I cloned your repo and compiled, and it failed. I then modified your .travis.yml file and was able to generate a shell script from travis compile. I've created a (PR)[https://github.com/PolymathNetwork/polymath-core/pull/154] for your project. It may be the case that your environment isn't configured correctly, but for sure your travis.yml file was incorrect.

@satyamakgec

This comment has been minimized.

Copy link

commented Jun 27, 2018

@ekivolowitz Thanks for all your efforts and time really appreciated. Could you please send me your Dockerfile so I will clone the same here on my end. It will be very helpful to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.