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

Ruby 3.2.2 install failure (1.12.0, 1.13.0) #856

Open
smathews opened this issue Mar 20, 2024 · 4 comments
Open

Ruby 3.2.2 install failure (1.12.0, 1.13.0) #856

smathews opened this issue Mar 20, 2024 · 4 comments

Comments

@smathews
Copy link

Using ruby 3.2.2 on Fedora 38. Upgrading from 1.11.1. I've uninstalled all gems and I'm still getting a failure when running travis. This happens with 1.12.0 and 1.13.0.

[smathews@fedora ~]$ ruby -v
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]
[smathews@fedora ~]$ gem install travis --no-document
Fetching launchy-2.5.2.gem
Fetching highline-2.1.0.gem
Fetching pusher-client-0.6.2.gem
Fetching faraday-net_http-3.0.2.gem
Fetching json_pure-2.6.3.gem
Fetching public_suffix-5.0.4.gem
Fetching faraday-2.7.12.gem
Fetching websocket-1.2.10.gem
Fetching faraday-rack-2.0.0.gem
Fetching addressable-2.8.6.gem
Fetching travis-1.13.0.gem
Successfully installed websocket-1.2.10
Successfully installed pusher-client-0.6.2
Successfully installed public_suffix-5.0.4
Successfully installed addressable-2.8.6
Successfully installed launchy-2.5.2
Successfully installed json_pure-2.6.3
Successfully installed highline-2.1.0
Successfully installed faraday-net_http-3.0.2
Successfully installed faraday-2.7.12
Successfully installed faraday-rack-2.0.0
Successfully installed travis-1.13.0
11 gems installed
[smathews@fedora ~]$ travis version
<internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- rack/test (LoadError)
        from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /home/smathews/.local/share/gem/ruby/gems/faraday-rack-2.0.0/lib/faraday/adapter/rack.rb:3:in `<top (required)>'
        from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /home/smathews/.local/share/gem/ruby/gems/faraday-rack-2.0.0/lib/faraday/rack.rb:4:in `<top (required)>'
        from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /home/smathews/.local/share/gem/ruby/gems/travis-1.13.0/lib/travis/client/session.rb:9:in `<top (required)>'
        from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /home/smathews/.local/share/gem/ruby/gems/travis-1.13.0/lib/travis/client.rb:9:in `<top (required)>'
        from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /home/smathews/.local/share/gem/ruby/gems/travis-1.13.0/lib/travis/cli.rb:4:in `<top (required)>'
        from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /home/smathews/.local/share/gem/ruby/gems/travis-1.13.0/bin/travis:9:in `<top (required)>'
        from /home/smathews/bin/travis:25:in `load'
        from /home/smathews/bin/travis:25:in `<main>'

I noticed that rack/test is in the dev dependencies, so I tried this as well.

[smathews@fedora ~]$ gem install --dev travis --no-document
Fetching rspec-3.13.0.gem
Fetching diff-lcs-1.5.1.gem
Fetching tilt-2.3.0.gem
Fetching rack-2.2.8.1.gem
Fetching rspec-expectations-3.13.0.gem
Fetching rspec-support-3.13.1.gem
Fetching rspec-core-3.13.0.gem
Fetching rack-test-2.1.0.gem
Fetching rspec-mocks-3.13.0.gem
Fetching rack-protection-3.0.6.gem
Fetching mustermann-3.0.0.gem
Fetching sinatra-3.0.6.gem
Fetching rspec-its-1.3.0.gem
Successfully installed tilt-2.3.0
Successfully installed rack-2.2.8.1
Successfully installed rack-test-2.1.0
Successfully installed rspec-support-3.13.1
Successfully installed rspec-core-3.13.0
ERROR:  Error installing travis:
        rspec requires rspec-expectations (~> 3.13.0)

I then installed rspec manually.

[smathews@fedora ~]$ gem install rspec
Successfully installed diff-lcs-1.5.1
Successfully installed rspec-mocks-3.13.0
Successfully installed rspec-expectations-3.13.0
Successfully installed rspec-3.13.0
Parsing documentation for diff-lcs-1.5.1
Installing ri documentation for diff-lcs-1.5.1
Parsing documentation for rspec-mocks-3.13.0
Installing ri documentation for rspec-mocks-3.13.0
Parsing documentation for rspec-expectations-3.13.0
Installing ri documentation for rspec-expectations-3.13.0
Parsing documentation for rspec-3.13.0
Installing ri documentation for rspec-3.13.0
Done installing documentation for diff-lcs, rspec-mocks, rspec-expectations, rspec after 2 seconds
4 gems installed

Still failure (although now different)

[smathews@fedora ~]$ gem install --dev travis --no-document
Successfully installed rack-protection-3.0.6
Successfully installed mustermann-3.0.0
Successfully installed sinatra-3.0.6
Successfully installed rspec-its-1.3.0
Successfully installed travis-1.13.0
5 gems installed
[smathews@fedora ~]$ travis version
/home/smathews/.local/share/gem/ruby/gems/travis-1.13.0/lib/travis/cli/command.rb:334:in `format': wrong number of arguments (given 5, expected 1..3) (ArgumentError)
        from /home/smathews/.local/share/gem/ruby/gems/travis-1.13.0/lib/travis/cli/command.rb:315:in `store_error'
        from /home/smathews/.local/share/gem/ruby/gems/travis-1.13.0/lib/travis/cli/command.rb:235:in `rescue in execute'
        from /home/smathews/.local/share/gem/ruby/gems/travis-1.13.0/lib/travis/cli/command.rb:200:in `execute'
        from /home/smathews/.local/share/gem/ruby/gems/travis-1.13.0/lib/travis/cli.rb:66:in `run'
        from /home/smathews/.local/share/gem/ruby/gems/travis-1.13.0/bin/travis:20:in `<top (required)>'
        from /home/smathews/bin/travis:25:in `load'
        from /home/smathews/bin/travis:25:in `<main>'
/home/smathews/.local/share/gem/ruby/gems/travis-1.13.0/lib/travis/tools/completion.rb:37:in `update_completion': undefined method `mkdir_p' for Travis::Tools::Completion:Module (NoMethodError)

        mkdir_p(config_path)
        ^^^^^^^
        from /home/smathews/.local/share/gem/ruby/gems/travis-1.13.0/lib/travis/cli/command.rb:178:in `check_completion'
        from /home/smathews/.local/share/gem/ruby/gems/travis-1.13.0/lib/travis/cli/command.rb:206:in `execute'
        from /home/smathews/.local/share/gem/ruby/gems/travis-1.13.0/lib/travis/cli.rb:66:in `run'
        from /home/smathews/.local/share/gem/ruby/gems/travis-1.13.0/bin/travis:20:in `<top (required)>'
        from /home/smathews/bin/travis:25:in `load'
        from /home/smathews/bin/travis:25:in `<main>'
@jimlindeman
Copy link

This also happens on my Mac with Ruby 3.2.3. I worked around the mkdir_p issue by manually changing the gems/travis-1.13.0/lib/travis/tools/completion.rb file around line 38 to be:

      def update_completion
        FileUtils.mkdir_p(config_path)
        FileUtils.cp(Assets['travis.sh'], cmp_file)
      end

instead of just:

      def update_completion
        mkdir_p(config_path)
        cp(Assets['travis.sh'], cmp_file)
      end

@jimlindeman
Copy link

The follow-up errors after the FileUtils.mkdir_p stuff above are from "gh" (github library) isn't installed by default, giving error like:

$ travis
<internal:/opt/homebrew/Cellar/[email protected]/3.2.3/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:136:in `require': cannot load such file -- gh (LoadError)
	from <internal:/opt/homebrew/Cellar/[email protected]/3.2.3/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/travis-1.13.0/lib/travis/tools/github.rb:7:in `<top (required)>'
	from <internal:/opt/homebrew/Cellar/[email protected]/3.2.3/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
	from <internal:/opt/homebrew/Cellar/[email protected]/3.2.3/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
...

Now if one does "gem install gh", the version will be incompatible with faraday library like:

$ travis
/opt/homebrew/Cellar/[email protected]/3.2.3/lib/ruby/3.2.0/rubygems/specification.rb:2317:in `raise_if_conflicts': Unable to activate gh-0.18.0, because faraday-2.7.12 conflicts with faraday (~> 1.0) (Gem::ConflictError)
	from /opt/homebrew/Cellar/[email protected]/3.2.3/lib/ruby/3.2.0/rubygems/specification.rb:1450:in `activate'
	from /opt/homebrew/Cellar/[email protected]/3.2.3/lib/ruby/3.2.0/rubygems.rb:205:in `rescue in try_activate'
	from /opt/homebrew/Cellar/[email protected]/3.2.3/lib/ruby/3.2.0/rubygems.rb:198:in `try_activate'
	from <internal:/opt/homebrew/Cellar/[email protected]/3.2.3/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:139:in `block in require'
	from <internal:/opt/homebrew/Cellar/[email protected]/3.2.3/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:139:in `synchronize'
	from <internal:/opt/homebrew/Cellar/[email protected]/3.2.3/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:139:in `rescue in require'
	from <internal:/opt/homebrew/Cellar/[email protected]/3.2.3/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:135:in `require'

So on linux (Jenkins job on Ubuntu that needed travis-cli), I I have successfully worked around this by manually building a gh branch gem like:

git clone https://github.com/travis-ci/gh
cd gh
git checkout -b prd-ruby-upgrade-dev remotes/origin/prd-ruby-upgrade-dev
echo "3.2.3" > .ruby-version
gem build gh.gemspec
find . -name gh-0.21.0.gem
gem install ./gh-0.21.0.gem

@clnperez
Copy link

clnperez commented Apr 16, 2024

i'm seeing this as well. i have never used ruby before, but installed it (on Fedora 39) to use the travis CLI. Any updates?

> ruby -v
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]
> gem install travis --no-document
Building native extensions. This could take a while...                                                                                                           
Successfully installed ffi-1.16.3                                                                                                                                
Successfully installed ethon-0.16.0                                                                                                                              
Successfully installed typhoeus-1.4.1                                                                                                                            
Successfully installed faraday-net_http-3.0.2                                                                                                                    
Successfully installed faraday-2.7.12                                                                                                                            
Successfully installed faraday-typhoeus-1.1.0                                                                                                                    
Successfully installed faraday-retry-2.2.1        
Successfully installed public_suffix-5.0.5          
Successfully installed addressable-2.8.6 
Successfully installed concurrent-ruby-1.2.3
Successfully installed tzinfo-2.0.6
Successfully installed minitest-5.22.3
Successfully installed i18n-1.14.4
Successfully installed activesupport-7.0.8.1
Successfully installed travis-gh-0.21.0
Successfully installed websocket-1.2.10
Successfully installed pusher-client-0.6.2
Successfully installed launchy-2.5.2
Successfully installed json_pure-2.6.3
Successfully installed highline-2.1.0
Successfully installed faraday-rack-2.0.0
Successfully installed travis-1.13.3
22 gems installed

> travis -v
<internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- rack/test (LoadError)
        from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /usr/local/share/gems/gems/faraday-rack-2.0.0/lib/faraday/adapter/rack.rb:3:in `<top (required)>'
        from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /usr/local/share/gems/gems/faraday-rack-2.0.0/lib/faraday/rack.rb:4:in `<top (required)>'
        from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /home/christy/.local/share/gem/ruby/gems/travis-1.13.3/lib/travis/client/session.rb:9:in `<top (required)>'
        from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /home/christy/.local/share/gem/ruby/gems/travis-1.13.3/lib/travis/client.rb:9:in `<top (required)>'
        from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /home/christy/.local/share/gem/ruby/gems/travis-1.13.3/lib/travis/cli.rb:4:in `<top (required)>'
        from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /home/christy/.local/share/gem/ruby/gems/travis-1.13.3/bin/travis:9:in `<top (required)>'
        from /home/christy/bin/travis:25:in `load'
        from /home/christy/bin/travis:25:in `<main>'

Edit: I ended up being able to install and use a much older version. In case anyone else here is a complete newbie like me and not familiar with the community whatsoever, but needs the travis cli, this runs locally: gem install travis -v 1.11.1

@chenrui333
Copy link

1.14.0 works for the brew build, Homebrew/homebrew-core#173434

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants