ruby gem install eventmachine -v '1.2.7'失败

68bkxrlz  于 2023-06-22  发布在  Ruby
关注(0)|答案(1)|浏览(144)

使用Ruby 3.2.1 bundle设置Jekyll时失败如下:

current directory: /Users/chandanj/.rvm/gems/ruby-3.2.1/gems/eventmachine-1.2.7/ext
make DESTDIR\= sitearchdir\=./.gem.20230620-52033-h7p7oy sitelibdir\=./.gem.20230620-52033-h7p7oy
compiling binder.cpp
In file included from binder.cpp:20:
./project.h:119:10: fatal error: 'openssl/ssl.h' file not found
#include <openssl/ssl.h>
         ^~~~~~~~~~~~~~~
1 error generated.
make: *** [binder.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/chandanj/.rvm/gems/ruby-3.2.1/gems/eventmachine-1.2.7 for inspection.
Results logged to /Users/chandanj/.rvm/gems/ruby-3.2.1/extensions/arm64-darwin-22/3.2.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-last-modified-at was resolved to 1.3.0, which depends on
    jekyll was resolved to 4.3.2, which depends on
      em-websocket was resolved to 0.5.3, which depends on
        eventmachine

经过大量的试验几个解决方案,以下工作,因此添加它在这里为任何面临相同问题的人。

d6kp6zgx

d6kp6zgx1#

删除Ruby 3.2.1

$>rvm uninstall 3.2.1
ruby-3.2.1 - #removing src/ruby-3.2.1 - please wait
ruby-3.2.1 - #removing rubies/ruby-3.2.1 - please wait

使用openssl@1.1安装Ruby 3.2.1

➜ rvm install 3.2.1 --with-openssl-dir=/opt/homebrew/opt/openssl@1.1
Checking requirements for osx.

发布此消息,bundle成功,但是,您将开始看到以下警告:

➜ bundle
Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
Fetching gem metadata from https://rubygems.org/.........

要解决这个问题,执行bundle update --bundler,警告就会消失。

相关问题