Skip to content

Not working on Apple Silicon (M1) - libhttp-parser-ext.bundle: mach-o, but wrong architecture #630

@rgaufman

Description

@rgaufman

I have this simple script:

require 'bundler/inline'

gemfile do
  source 'https://rubygems.org'
  gem 'http'
end

response = HTTP.post('http://example.com', json: nil)

I also tried with gem 'http', github: 'httprb/http'

I get this output:

Romans-MacBook-Air.local ➜  scripts git:(master) ✗ ruby test-http.rb
Traceback (most recent call last):
	24: from test-http-arse.rb:6:in `<main>'
	23: from /opt/homebrew/Cellar/ruby/2.7.2/lib/ruby/2.7.0/bundler/inline.rb:54:in `gemfile'
	22: from /opt/homebrew/Cellar/ruby/2.7.2/lib/ruby/2.7.0/bundler/settings.rb:124:in `temporary'
	21: from /opt/homebrew/Cellar/ruby/2.7.2/lib/ruby/2.7.0/bundler/inline.rb:70:in `block in gemfile'
	20: from /opt/homebrew/Cellar/ruby/2.7.2/lib/ruby/2.7.0/bundler/runtime.rb:58:in `require'
	19: from /opt/homebrew/Cellar/ruby/2.7.2/lib/ruby/2.7.0/bundler/runtime.rb:58:in `each'
	18: from /opt/homebrew/Cellar/ruby/2.7.2/lib/ruby/2.7.0/bundler/runtime.rb:69:in `block in require'
	17: from /opt/homebrew/Cellar/ruby/2.7.2/lib/ruby/2.7.0/bundler/runtime.rb:69:in `each'
	16: from /opt/homebrew/Cellar/ruby/2.7.2/lib/ruby/2.7.0/bundler/runtime.rb:74:in `block (2 levels) in require'
	15: from /opt/homebrew/Cellar/ruby/2.7.2/lib/ruby/2.7.0/bundler/runtime.rb:74:in `require'
	14: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/http-4.4.1/lib/http.rb:8:in `<top (required)>'
	13: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/http-4.4.1/lib/http.rb:8:in `require'
	12: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/http-4.4.1/lib/http/client.rb:9:in `<top (required)>'
	11: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/http-4.4.1/lib/http/client.rb:9:in `require'
	10: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/http-4.4.1/lib/http/connection.rb:6:in `<top (required)>'
	 9: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/http-4.4.1/lib/http/connection.rb:6:in `require'
	 8: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/http-4.4.1/lib/http/response/parser.rb:3:in `<top (required)>'
	 7: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/http-4.4.1/lib/http/response/parser.rb:3:in `require'
	 6: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/http-parser-1.2.2/lib/http-parser.rb:5:in `<top (required)>'
	 5: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/http-parser-1.2.2/lib/http-parser.rb:5:in `require'
	 4: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/http-parser-1.2.2/lib/http-parser/ext.rb:6:in `<top (required)>'
	 3: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/http-parser-1.2.2/lib/http-parser/ext.rb:8:in `<module:HttpParser>'
	 2: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/ffi-1.13.1/lib/ffi/library.rb:99:in `ffi_lib'
	 1: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/ffi-1.13.1/lib/ffi/library.rb:99:in `map'
/opt/homebrew/lib/ruby/gems/2.7.0/gems/ffi-1.13.1/lib/ffi/library.rb:145:in `block in ffi_lib': Could not open library '/opt/homebrew/lib/ruby/gems/2.7.0/gems/http-parser-1.2.2/ext/arm-darwin/libhttp-parser-ext.bundle': dlopen(/opt/homebrew/lib/ruby/gems/2.7.0/gems/http-parser-1.2.2/ext/arm-darwin/libhttp-parser-ext.bundle, 5): no suitable image found.  Did find: (LoadError)
	/opt/homebrew/lib/ruby/gems/2.7.0/gems/http-parser-1.2.2/ext/arm-darwin/libhttp-parser-ext.bundle: mach-o, but wrong architecture
	/opt/homebrew/lib/ruby/gems/2.7.0/gems/http-parser-1.2.2/ext/arm-darwin/libhttp-parser-ext.bundle: stat() failed with errno=25

From what I can tell http-parser is no longer maintained and was replaced by llhttp

Is there any solution to getting this gem working on Apple Silicon?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions