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 build http-parser native extension on Heroku #16

Open
arbales opened this issue Dec 26, 2021 · 7 comments
Open

Cannot build http-parser native extension on Heroku #16

arbales opened this issue Dec 26, 2021 · 7 comments

Comments

@arbales
Copy link

arbales commented Dec 26, 2021

I've been unable to build the http-parser gem on Heroku with Ruby 3.0+. Have tried bumping my Ruby version to no avail.

remote:        Installing http-parser 1.2.3 with native extensions
remote:        Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
remote:
remote:        current directory:
remote:        /tmp/build_54efc73d/vendor/bundle/ruby/3.1.0/gems/http-parser-1.2.3/ext
remote:        /tmp/build_54efc73d/vendor/ruby-3.1.0/bin/ruby
remote:        -I/tmp/build_54efc73d/vendor/ruby-3.1.0/lib/ruby/3.1.0 -rrubygems
remote:        /tmp/build_54efc73d/vendor/bundle/ruby/3.1.0/gems/rake-12.3.3/exe/rake
remote:        RUBYARCHDIR\=/tmp/build_54efc73d/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/http-parser-1.2.3
remote:        RUBYLIBDIR\=/tmp/build_54efc73d/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/http-parser-1.2.3
remote:        rake aborted!
remote:        ArgumentError: wrong number of arguments (given 2, expected 1)
remote:        /tmp/build_54efc73d/vendor/bundle/ruby/3.1.0/gems/rake-12.3.3/exe/rake:27:in
remote:        `<main>'
remote:        Tasks: TOP => default => x86_64-linux/libhttp-parser-ext.so =>
remote:        x86_64-linux/http-parser/http_parser.o => x86_64-linux/http-parser
remote:        (See full trace by running task with --trace)
remote:
remote:        rake failed, exit code 1
remote:
remote:        Gem files will remain installed in
remote:        /tmp/build_54efc73d/vendor/bundle/ruby/3.1.0/gems/http-parser-1.2.3 for
remote:        inspection.
remote:        Results logged to
remote:        /tmp/build_54efc73d/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/http-parser-1.2.3/gem_make.out

remote:
remote:        An error occurred while installing http-parser (1.2.3), and Bundler cannot
remote:        continue.
remote:
remote:        In Gemfile:
remote:          http was resolved to 4.4.1, which depends on
remote:            http-parser
@robert-damoc
Copy link

robert-damoc commented Feb 21, 2022

Have you managed to find a fix for this? I have kind of the same issue, where on local it works, but it fails on the CI, with the same message.

It worked on ruby 2.7.5. Now I am trying to go to 3.0.3, and it's failing.

@arbales
Copy link
Author

arbales commented Feb 21, 2022

Yes! Bump your http gem version or build it from source, it removes this dependency.

@erwinwolff
Copy link

I have this same problem. What was your fix?

@arbales
Copy link
Author

arbales commented Mar 22, 2022

See above, just use the gem from GitHub.

@erwinwolff
Copy link

Still doesnt really work

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

    current directory: /****/vendor/ruby/3.0.0/bundler/gems/http-parser-4a0db044c746/ext
/usr/bin/ruby -I/usr/lib/ruby/site_ruby/3.0.0 -rrubygems /****/vendor/ruby/3.0.0/gems/rake-13.0.6/exe/rake RUBYARCHDIR\=/******/vendor/ruby/3.0.0/bundler/gems/extensions/x86_64-linux/3.0.0-static/http-parser-4a0db044c746
RUBYLIBDIR\=/*****/vendor/ruby/3.0.0/bundler/gems/extensions/x86_64-linux/3.0.0-static/http-parser-4a0db044c746
gcc -shared -o x86_64-linux/libhttp-parser-ext.so  -fexceptions
gcc: fatal error: no input files
compilation terminated.
rake aborted!
Command failed with status (1): [gcc -shared -o x86_64-linux/libhttp-parser...]
/*****/vendor/ruby/3.0.0/gems/ffi-compiler-1.0.1/lib/ffi-compiler/compile_task.rb:153:in `block in define_task!'
/*****/vendor/ruby/3.0.0/gems/rake-13.0.6/exe/rake:27:in `<main>'
Tasks: TOP => default => x86_64-linux/libhttp-parser-ext.so
(See full trace by running task with --trace)

rake failed, exit code 1

Gem files will remain installed in /****/vendor/ruby/3.0.0/bundler/gems/http-parser-4a0db044c746 for inspection.
Results logged to /****/vendor/ruby/3.0.0/bundler/gems/extensions/x86_64-linux/3.0.0-static/http-parser-4a0db044c746/gem_make.out

An error occurred while installing http-parser (1.2.3), and Bundler cannot continue.

@erwinwolff
Copy link

rake --version
rake, version 13.0.6

@arbales
Copy link
Author

arbales commented Mar 23, 2022

Ah sorry, you know -- I updated the http gem not this parser gem. The http gem removes this dep in their update. I wasn't able to build http-parser.

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

3 participants