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

Install gem in Github Action with bundler-cache fails #172

Open
trombini77 opened this issue Jul 31, 2023 · 2 comments
Open

Install gem in Github Action with bundler-cache fails #172

trombini77 opened this issue Jul 31, 2023 · 2 comments

Comments

@trombini77
Copy link

trombini77 commented Jul 31, 2023

When is to install using in Github Actions with bundler cache like this:

      - name: Set Ruby version
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: 3.2.2
          bundler-cache: true # runs 'bundle install' and caches installed gems automatically

is not possible with the following error messages:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/home/runner/work/card-processor-ms/card-processor-ms/vendor/bundle/ruby/3.2.0/gems/mimemagic-0.4.3/ext/mimemagic
/opt/hostedtoolcache/Ruby/3.2.2/x64/bin/ruby -rrubygems
/home/runner/work/card-processor-ms/card-processor-ms/vendor/bundle/ruby/3.2.0/gems/rake-12.3.3/exe/rake
RUBYARCHDIR\=/home/runner/work/card-processor-ms/card-processor-ms/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/mimemagic-0.4.3
RUBYLIBDIR\=/home/runner/work/card-processor-ms/card-processor-ms/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/mimemagic-0.4.3
rake aborted!
ArgumentError: wrong number of arguments (given 2, expected 1)
/home/runner/work/card-processor-ms/card-processor-ms/vendor/bundle/ruby/3.2.0/gems/mimemagic-0.4.3/ext/mimemagic/Rakefile:28:in
`block in <top (required)>'
/home/runner/work/card-processor-ms/card-processor-ms/vendor/bundle/ruby/3.2.0/gems/rake-12.3.3/exe/rake:27:in
`<main>'
Tasks: TOP => default
(See full trace by running task with --trace)

rake failed, exit code 1

Gem files will remain installed in
/home/runner/work/card-processor-ms/card-processor-ms/vendor/bundle/ruby/3.2.0/gems/mimemagic-0.4.3
for inspection.
Results logged to
/home/runner/work/card-processor-ms/card-processor-ms/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/mimemagic-0.4.3/gem_make.out

/opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/3.2.0/rubygems/ext/builder.rb:119:in
`run'
/opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/3.2.0/rubygems/ext/rake_builder.rb:28:in
`build'
/opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/3.2.0/rubygems/ext/builder.rb:187:in
`build_extension'
/opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/3.2.0/rubygems/ext/builder.rb:221:in
`block in build_extensions'
/opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/3.2.0/rubygems/ext/builder.rb:218:in
`each'
/opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/3.2.0/rubygems/ext/builder.rb:218:in
`build_extensions'
/opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/3.2.0/rubygems/installer.rb:843:in
`build_extensions'
/opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/gems/3.2.0/gems/bundler-2.4.14/lib/bundler/rubygems_gem_installer.rb:72:in
`build_extensions'
/opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/gems/3.2.0/gems/bundler-2.4.14/lib/bundler/rubygems_gem_installer.rb:28:in
`install'
/opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/gems/3.2.0/gems/bundler-2.4.14/lib/bundler/source/rubygems.rb:201:in
`install'
/opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/gems/3.2.0/gems/bundler-2.4.14/lib/bundler/installer/gem_installer.rb:54:in
`install'
/opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/gems/3.2.0/gems/bundler-2.4.14/lib/bundler/installer/gem_installer.rb:16:in
`install_from_spec'
/opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/gems/3.2.0/gems/bundler-2.4.14/lib/bundler/installer/parallel_installer.rb:156:in
`do_install'
/opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/gems/3.2.0/gems/bundler-2.4.14/lib/bundler/installer/parallel_installer.rb:147:in
`block in worker_pool'
/opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/gems/3.2.0/gems/bundler-2.4.14/lib/bundler/worker.rb:62:in
`apply_func'
/opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/gems/3.2.0/gems/bundler-2.4.14/lib/bundler/worker.rb:57:in
`block in process_queue'
/opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/gems/3.2.0/gems/bundler-2.4.14/lib/bundler/worker.rb:54:in
`loop'
/opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/gems/3.2.0/gems/bundler-2.4.14/lib/bundler/worker.rb:54:in
`process_queue'
/opt/hostedtoolcache/Ruby/3.2.2/x64/lib/ruby/gems/3.2.0/gems/bundler-2.4.14/lib/bundler/worker.rb:90:in
`block (2 levels) in create_threads'

An error occurred while installing mimemagic (0.4.3), and Bundler cannot
continue.

In Gemfile:
  mimemagic
Error: The process '/opt/hostedtoolcache/Ruby/3.2.2/x64/bin/bundle' failed with exit code 5

PS. the name card-processor-ms is the repository name where was the workflow was runned.

@nWhitehill
Copy link

Were you able to find a workaround besides not caching? It seems other people are having the same issue - #162 (comment)

@trombini77
Copy link
Author

Only to update the scenario data:

Ruby: 3.2.2
Rails: 7.0.5
mimemagic: 0.4.3

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

2 participants