Repository navigation
/lib/ruby/gems/2.7.0/gems/http-parser-1.2.2/ext/arm-darwin/libhttp-parser-ext.bundle: mach-o, but wrong architecture #12
Copy link
Copy link
Open
Description
I've created a simple script:
require 'json'
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'http'
end
response = HTTP.post('http://example.com', json: nil)When I run it on MacBook 2020 M1 (Apple Silicon), I see:
Traceback (most recent call last):
24: from test-http-arse.rb:8: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
Any ideas?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
TheMlok commentedon Dec 28, 2020
We have it like a dependency in Rails application, please any solution how to run it on M1?
stevehodgkiss commentedon Dec 28, 2020
There's an open PR to address this issue #10
DaniG2k commentedon Jan 10, 2021
I'm having a similar problem on a Rails 5.0.7.2 app. Tried installing
http-parser1.2.2 but I get the same message 🤔 :I believe the
httpgem is the one requiringhttp-parser.rgaufman commentedon Jan 10, 2021
http-parser is a dependency of httbrb for us. Our solution was to switch to faraday which removed this dependency.
stevenjohn commentedon Jan 20, 2021
Hi there,
I'm on Apple Silicon and getting the same error as @rgaufman
I'm installing v 1.2.3 and I'm confused as it looks like the PR to fix the m1 chip issue was merged?
Any ideas how I get http-parser to install correctly?
Many thanks, Steve.
nitrnitr commentedon Feb 11, 2021
Fixing the http-version on the Gemfile did it for me, new version has this fixed
gem 'http-parser', '~> 1.2.3'rstammer commentedon Sep 18, 2021
Unfortunately, for Ruby 2.7.x, I still do face the issue when trying to
gem install http-parser -v '1.2.3', so what @nitrnitr described does not apply to my situation so far.Here's the error log:
Any ideas?
ryanstuhl805 commentedon Nov 19, 2021
Similar output happening with a non M1 machine recently updated to Mac OS Monterey.