已经有多个类似的帐户,但这里发生了一些不同的事情。我把这个问题写在这里。
背景信息:
$ which ruby
/Users/johnlarkin/.rvm/rubies/ruby-3.1.3/bin/ruby
$ ruby -v
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [arm64-darwin22]
$ which openssl
/opt/homebrew/opt/openssl@3/bin/openssl
$ openssl version
OpenSSL 3.1.0 14 Mar 2023 (Library: OpenSSL 3.1.0 14 Mar 2023)
我可以这样安装eventmachine
:
$ gem install eventmachine -v '1.2.7' -- --with-ssl-dir=/opt/homebrew/opt/openssl@3
Building native extensions with: '--with-ssl-dir=/opt/homebrew/opt/openssl@3'
This could take a while...
Successfully installed eventmachine-1.2.7
Parsing documentation for eventmachine-1.2.7
Done installing documentation for eventmachine after 0 seconds
1 gem installed
然而,当我去bundle install
,它仍然不工作:
^
4 warnings generated.
linking shared-object rubyeventmachine.bundle
Undefined symbols for architecture arm64:
"_SSL_get1_peer_certificate", referenced from:
SslBox_t::GetPeerCert() in ssl.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [rubyeventmachine.bundle] Error 1
make failed, exit code 2
Gem files will remain installed in
/Users/johnlarkin/Desktop/Coding_Learning/github_files/johnlarkin1.github.io/vendor/bundle/ruby/3.1.0/gems/eventmachine-1.2.7
for inspection.
Results logged to
/Users/johnlarkin/Desktop/Coding_Learning/github_files/johnlarkin1.github.io/vendor/bundle/ruby/3.1.0/extensions/arm64-darwin-22/3.1.0/eventmachine-1.2.7/gem_make.out
An error occurred while installing eventmachine (1.2.7), and Bundler cannot continue.
Make sure that `gem install eventmachine -v '1.2.7' --source 'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
jekyll-sleek was resolved to 0.1.9, which depends on
jekyll-seo-tag was resolved to 2.8.0, which depends on
jekyll was resolved to 3.9.2, which depends on
em-websocket was resolved to 0.5.3, which depends on
eventmachine
有人有什么想法吗?
非常感谢@tadman的建议。问题是bundle config settings
(link)
似乎是由于先前错误的命令规范,有关构建过程的某些内容被缓存了。
我跑:
$ bundle config build.eventmachine --with-ssl-dir=/opt/homebrew/opt/openssl@3
You are replacing the current global value of build.eventmachine,
which is currently "--with-cppflags=-I/opt/homebrew/opt/openssl@3/include"
操作完成后,bundle install
开始完全正常工作。再次感谢你@tadman!