Open rgaufman opened 3 years ago
We have it like a dependency in Rails application, please any solution how to run it on M1?
There's an open PR to address this issue https://github.com/cotag/http-parser/pull/10
I'm having a similar problem on a Rails 5.0.7.2 app. Tried installing http-parser
1.2.2 but I get the same message 🤔 :
LoadError: Could not open library '/Users/danig2k/.rvm/gems/ruby-2.6.6/gems/http-parser-1.2.2/ext/aarch64-darwin/libhttp-parser-ext.bundle': dlopen(/Users/danig2k/.rvm/gems/ruby-2.6.6/gems/http-parser-1.2.2/ext/aarch64-darwin/libhttp-parser-ext.bundle, 5): no suitable image found. Did find:
/Users/danig2k/.rvm/gems/ruby-2.6.6/gems/http-parser-1.2.2/ext/aarch64-darwin/libhttp-parser-ext.bundle: mach-o, but wrong architecture
/Users/danig2k/.rvm/gems/ruby-2.6.6/gems/http-parser-1.2.2/ext/aarch64-darwin/libhttp-parser-ext.bundle: stat() failed with errno=25
I believe the http
gem is the one requiring http-parser
.
http-parser is a dependency of httbrb for us. Our solution was to switch to faraday which removed this dependency.
Hi there,
I'm on Apple Silicon and getting the same error as @rgaufman
Building native extensions. This could take a while...
ERROR: Error installing http-parser:
ERROR: Failed to build gem native extension.
current directory: /Users/steve/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/http-parser-1.2.3/ext
/Users/steve/.rbenv/versions/2.6.6/bin/ruby -rrubygems /Users/steve/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rake-12.3.3/exe/rake RUBYARCHDIR\=/Users/steve/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/extensions/-darwin-20/2.6.0/http-parser-1.2.3 RUBYLIBDIR\=/Users/steve/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/extensions/-darwin-20/2.6.0/http-parser-1.2.3
rake aborted!
LoadError: dlopen(/Users/steve/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/ffi-1.14.2/lib/ffi_c.bundle, 9): no suitable image found. Did find:
/Users/steve/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/ffi-1.14.2/lib/ffi_c.bundle: mach-o, but wrong architecture
/Users/steve/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/ffi-1.14.2/lib/ffi_c.bundle: mach-o, but wrong architecture - /Users/steve/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/ffi-1.14.2/lib/ffi_c.bundle
Caused by:
LoadError: cannot load such file -- 2.6/ffi_c
Caused by:
LoadError: cannot load such file -- ffi-compiler/compile_task
(See full trace by running task with --trace)
rake failed, exit code 1
Gem files will remain installed in /Users/steve/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/http-parser-1.2.3 for inspection.
Results logged to /Users/steve/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/extensions/-darwin-20/2.6.0/http-parser-1.2.3/gem_make.out
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.
Fixing the http-version on the Gemfile did it for me, new version has this fixed
gem 'http-parser', '~> 1.2.3'
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:
LoadError: dlopen(/Users/robinstammer/.rvm/gems/ruby-2.7.4/gems/ffi-1.15.4/lib/ffi_c.bundle, 9): no suitable image found. Did find:
/Users/robinstammer/.rvm/gems/ruby-2.7.4/gems/ffi-1.15.4/lib/ffi_c.bundle: mach-o, but wrong architecture
/Users/robinstammer/.rvm/gems/ruby-2.7.4/gems/ffi-1.15.4/lib/ffi_c.bundle: mach-o, but wrong architecture - /Users/robinstammer/.rvm/gems/ruby-2.7.4/gems/ffi-1.15.4/lib/ffi_c.bundle
/Users/robinstammer/.rvm/gems/ruby-2.7.4/gems/ffi-1.15.4/lib/ffi.rb:5:in `rescue in <top (required)>'
/Users/robinstammer/.rvm/gems/ruby-2.7.4/gems/ffi-1.15.4/lib/ffi.rb:2:in `<top (required)>'
/Users/robinstammer/.rvm/gems/ruby-2.7.4/gems/ffi-compiler-1.0.1/lib/ffi-compiler/compile_task.rb:4:in `<top (required)>'
/Users/robinstammer/.rvm/gems/ruby-2.7.4/gems/http-parser-1.2.3/ext/Rakefile:1:in `<top (required)>'
/Users/robinstammer/.rvm/gems/ruby-2.7.4/gems/rake-13.0.6/exe/rake:27:in `<main>'
Caused by:
LoadError: cannot load such file -- 2.7/ffi_c
/Users/robinstammer/.rvm/gems/ruby-2.7.4/gems/ffi-1.15.4/lib/ffi.rb:3:in `<top (required)>'
/Users/robinstammer/.rvm/gems/ruby-2.7.4/gems/ffi-compiler-1.0.1/lib/ffi-compiler/compile_task.rb:4:in `<top (required)>'
/Users/robinstammer/.rvm/gems/ruby-2.7.4/gems/http-parser-1.2.3/ext/Rakefile:1:in `<top (required)>'
/Users/robinstammer/.rvm/gems/ruby-2.7.4/gems/rake-13.0.6/exe/rake:27:in `<main>'
Caused by:
LoadError: cannot load such file -- ffi-compiler/compile_task
/Users/robinstammer/.rvm/gems/ruby-2.7.4/gems/http-parser-1.2.3/ext/Rakefile:1:in `<top (required)>'
/Users/robinstammer/.rvm/gems/ruby-2.7.4/gems/rake-13.0.6/exe/rake:27:in `<main>'
(See full trace by running task with --trace)
rake failed, exit code 1
Any ideas?
Similar output happening with a non M1 machine recently updated to Mac OS Monterey.
Installing llhttp-ffi 0.4.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/snip/Git/admin/.bundle/ruby/2.7.0/gems/llhttp-ffi-0.4.0/ext
/Users/snip/.rbenv/versions/2.7.4/bin/ruby -I/Users/snip/.rbenv/versions/2.7.4/lib/ruby/2.7.0/rubygems -rrubygems /Users/snip/Git/admin/.bundle/ruby/2.7.0/gems/rake-13.0.6/exe/rake
RUBYARCHDIR\=/Users/snip/Git/admin/.bundle/ruby/2.7.0/extensions/x86_64-darwin-20/2.7.0/llhttp-ffi-0.4.0 RUBYLIBDIR\=/Users/snip/Git/admin/.bundle/ruby/2.7.0/extensions/x86_64-darwin-20/2.7.0/llhttp-ffi-0.4.0
rake aborted!
LoadError: incompatible library version - /Users/snip/Git/admin/.bundle/ruby/2.7.0/extensions/x86_64-darwin-20/2.7.0/ffi-1.15.4/ffi_c.bundle
/Users/snip/Git/admin/.bundle/ruby/2.7.0/gems/ffi-1.15.4/lib/ffi.rb:5:in `rescue in <top (required)>'
/Users/snip/Git/admin/.bundle/ruby/2.7.0/gems/ffi-1.15.4/lib/ffi.rb:2:in `<top (required)>'
/Users/snip/Git/admin/.bundle/ruby/2.7.0/gems/ffi-compiler-1.0.1/lib/ffi-compiler/compile_task.rb:4:in `<top (required)>'
/Users/snip/Git/admin/.bundle/ruby/2.7.0/gems/llhttp-ffi-0.4.0/ext/Rakefile:3:in `<top (required)>'
/Users/snip/Git/admin/.bundle/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<main>'
Caused by:
LoadError: cannot load such file -- 2.7/ffi_c
/Users/snip/Git/admin/.bundle/ruby/2.7.0/gems/ffi-1.15.4/lib/ffi.rb:3:in `<top (required)>'
/Users/snip/Git/admin/.bundle/ruby/2.7.0/gems/ffi-compiler-1.0.1/lib/ffi-compiler/compile_task.rb:4:in `<top (required)>'
/Users/snip/Git/admin/.bundle/ruby/2.7.0/gems/llhttp-ffi-0.4.0/ext/Rakefile:3:in `<top (required)>'
/Users/snip/Git/admin/.bundle/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<main>'
Caused by:
LoadError: cannot load such file -- ffi-compiler/compile_task
/Users/snip/Git/admin/.bundle/ruby/2.7.0/gems/llhttp-ffi-0.4.0/ext/Rakefile:3:in `<top (required)>'
/Users/snip/Git/admin/.bundle/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<main>'
(See full trace by running task with --trace)
An error occurred while installing llhttp-ffi (0.4.0), and Bundler cannot continue.
In Gemfile:
noticed was resolved to 1.5.3, which depends on
http was resolved to 5.0.4, which depends on
llhttp-ffi
I've created a simple script:
When I run it on MacBook 2020 M1 (Apple Silicon), I see:
Any ideas?