travis-ci / travis.rb

Travis CI Client (CLI and Ruby library)
MIT License
1.59k stars 409 forks source link

Install Travis in Google Cloud Shell #677

Open jwdinkel opened 5 years ago

jwdinkel commented 5 years ago

Hello,

I would like to get the procedure for using Travis-CI from Google Cloud Shell formalized. It is easy to open a cloud shell with editor and type: sudo gem install travis

This causes an install:

Successfully installed travis-1.8.10
Parsing documentation for travis-1.8.10
Done installing documentation for travis after 1 seconds
1 gem installed

However when I run: travis I end up with

travis
Traceback (most recent call last):
        8: from /usr/local/bin/travis:23:in `<main>'
        7: from /usr/local/lib/ruby/2.6.0/rubygems.rb:303:in `activate_bin_path'
        6: from /usr/local/lib/ruby/2.6.0/rubygems.rb:303:in `synchronize'
        5: from /usr/local/lib/ruby/2.6.0/rubygems.rb:304:in `block in activate_bin_path'
        4: from /usr/local/lib/ruby/2.6.0/rubygems/specification.rb:1420:in `activate'
        3: from /usr/local/lib/ruby/2.6.0/rubygems/specification.rb:1438:in `activate_dependencies'
        2: from /usr/local/lib/ruby/2.6.0/rubygems/specification.rb:1438:in `each'
        1: from /usr/local/lib/ruby/2.6.0/rubygems/specification.rb:1449:in `block in activate_dependencies'
/usr/local/lib/ruby/2.6.0/rubygems/dependency.rb:311:in `to_specs': Could not find 'faraday' (~> 0.9) among 107 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/home/myname/.gems:/usr/local/lib/ruby/gems/2.6.0', execute `gem env` for more information

This worked before and I was able to edit settings in Travis and rotate keys and other things. Is it possible that a recent change broke things? I would also like to know if anybody can tell me how to setup Google Cloud Shell to permanently recognize Travis commands.

For example, with AWS, the CLI can be install permanently using PIP with a user flag like this: pip install --upgrade awscli --user

Thank you for the assistance. Best Regards!

jwdinkel commented 5 years ago

Tried walking through all the missing components: faraday faraday_middleware multipart-post highline

And still when I get to a successful install of highline, running travis causes this:

Traceback (most recent call last):
        8: from /usr/local/bin/travis:23:in `<main>'
        7: from /usr/local/lib/ruby/2.6.0/rubygems.rb:303:in `activate_bin_path'
        6: from /usr/local/lib/ruby/2.6.0/rubygems.rb:303:in `synchronize'
        5: from /usr/local/lib/ruby/2.6.0/rubygems.rb:304:in `block in activate_bin_path'
        4: from /usr/local/lib/ruby/2.6.0/rubygems/specification.rb:1420:in `activate'
        3: from /usr/local/lib/ruby/2.6.0/rubygems/specification.rb:1438:in `activate_dependencies'
        2: from /usr/local/lib/ruby/2.6.0/rubygems/specification.rb:1438:in `each'
        1: from /usr/local/lib/ruby/2.6.0/rubygems/specification.rb:1449:in `block in activate_dependencies'
/usr/local/lib/ruby/2.6.0/rubygems/dependency.rb:313:in `to_specs': Could not find 'highline' (~> 1.6) - did find: [highline-2.0.2] (Gem::MissingSpecVersionError)

I had to run all of these commands and take several versions that were from my prior notes to get this working...

sudo gem install travis -v 1.8.9
sudo gem install highline -v 1.7.10
sudo gem install backports
sudo gem install gh
sudo gem install multi_json
sudo gem install addressable
sudo gem install addressable -v 2.4.0
sudo gem install net-http-persistent -v 2.9.4
sudo gem install net-http-pipeline
sudo gem install launchy
jwdinkel commented 5 years ago

Seems to be fixed today. Install works. Just has an error /usr/local/lib/ruby/gems/2.6.0/gems/travis-1.8.10/lib/travis/tools/system.rb:79: warning: Insecure world writable dir /google/gopath/bin in PATH, mode 040777 as was the case before....

I will leave the issue open since I would really like help from somebody that can tell me how to do a permanent install (local user account) for a ruby gem in Google Cloud Shell: https://console.cloud.google.com/cloudshell/editor.

Thank you.