ruby - eventmachine安装中的捆绑安装错误
问题描述
我在尝试运行 ruby 项目OPEN-NDC-PROJECT时遇到问题。
捆绑安装
Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Using rake 13.0.3
Using concurrent-ruby 1.1.8
Using i18n 1.5.1
Using minitest 5.14.3
Using thread_safe 0.3.6
Using tzinfo 1.2.9
Using activesupport 5.0.7.2
Using activemodel 5.0.7.2
Using arel 7.1.4
Using activerecord 5.0.7.2
Using awesome_print 1.8.0
Using descendants_tracker 0.0.4
Using ice_nine 0.11.2
Using axiom-types 0.1.1
Using dependor 1.0.1
Using bogus 0.1.6
Using builder 3.2.4
Using bundler 1.17.3
Using chronic 0.10.2
Using coderay 1.1.3
Using coercible 1.0.0
Using daemons 1.3.1
Using database_cleaner-core 2.0.1
Using database_cleaner-active_record 2.0.0
Using database_cleaner 2.0.1
Using diffy 3.4.0
Using equalizer 0.0.11
Fetching eventmachine 1.2.7
Installing eventmachine 1.2.7 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/userName/.rbenv/versions/2.2.2/bin/ruby -r
./siteconf20210217-76181-1jmnsjp.rb extconf.rb
--with-cppflags=-I/usr/local/opt/openssl/include
checking for main() in -lcrypto... no
checking for openssl/ssl.h... yes
checking for openssl/err.h... yes
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... no
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for rb_thread_fd_select()... yes
checking for rb_fdset_t in ruby/intern.h... yes
checking for rb_wait_for_single_fd()... no
checking for rb_enable_interrupt()... no
checking for rb_time_new()... yes
checking for inotify_init() in sys/inotify.h... no
checking for __NR_inotify_init in sys/syscall.h... no
checking for writev() in sys/uio.h... yes
checking for pipe2() in unistd.h... no
checking for accept4() in sys/socket.h... no
checking for SOCK_CLOEXEC in sys/socket.h... no
checking for sys/event.h... yes
checking for sys/queue.h... yes
checking for clock_gettime()... no
checking for gethrtime()... no
CXXFLAGS=$(cxxflags) -Wall -Wextra -Wno-deprecated-declarations
-Wno-ignored-qualifiers -Wno-unused-result -Wno-address
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling page.cpp
compiling pipe.cpp
compiling binder.cpp
compiling rubymain.cpp
compiling ssl.cpp
compiling ed.cpp
compiling cmain.cpp
compiling em.cpp
em.cpp:706:13: error: use of undeclared identifier 'rb_thread_select'; did you
mean 'rb_thread_fd_select'?
if ((ret = rb_thread_select(kqfd + 1, &fdreads, NULL, NULL, &tv)) < 1) {
^~~~~~~~~~~~~~~~
rb_thread_fd_select
/Users/userName/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/intern.h:454:5:
note: 'rb_thread_fd_select' declared here
int rb_thread_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct
timeval *);
^
em.cpp:706:40: error: cannot initialize a parameter of type 'rb_fdset_t *' with an
rvalue of type 'fd_set *'
if ((ret = rb_thread_select(kqfd + 1, &fdreads, NULL, NULL, &tv)) < 1) {
^~~~~~~~
/Users/userName/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/intern.h:454:42:
note: passing argument to parameter here
int rb_thread_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct
timeval *);
^
2 errors generated.
make: *** [em.o] Error 1
make failed, exit code 2
Gem files will remain installed in
/Users/userName/RubymineProjects/ndc-sandbox/vendor/bundle/ruby/2.2.0/gems/eventmachine-1.2.7
for inspection.
Results logged to
/Users/userName/RubymineProjects/ndc-sandbox/vendor/bundle/ruby/2.2.0/extensions/x86_64-darwin-19/2.2.0-static/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:
thin was resolved to 1.8.0, which depends on
eventmachine
gem_make.out
/Users/userName/.rbenv/versions/2.2.2/bin/ruby -r ./siteconf20210217-73483-4tmlc2.rb extconf.rb --with-cppflags=-I/usr/local/opt/openssl/include
checking for main() in -lcrypto... no
checking for openssl/ssl.h... yes
checking for openssl/err.h... yes
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... no
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for rb_thread_fd_select()... yes
checking for rb_fdset_t in ruby/intern.h... yes
checking for rb_wait_for_single_fd()... no
checking for rb_enable_interrupt()... no
checking for rb_time_new()... yes
checking for inotify_init() in sys/inotify.h... no
checking for __NR_inotify_init in sys/syscall.h... no
checking for writev() in sys/uio.h... yes
checking for pipe2() in unistd.h... no
checking for accept4() in sys/socket.h... no
checking for SOCK_CLOEXEC in sys/socket.h... no
checking for sys/event.h... yes
checking for sys/queue.h... yes
checking for clock_gettime()... no
checking for gethrtime()... no
CXXFLAGS=$(cxxflags) -Wall -Wextra -Wno-deprecated-declarations -Wno-ignored-qualifiers -Wno-unused-result -Wno-address
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling page.cpp
compiling pipe.cpp
compiling binder.cpp
compiling rubymain.cpp
compiling ssl.cpp
compiling ed.cpp
compiling cmain.cpp
compiling em.cpp
em.cpp:706:13: error: use of undeclared identifier 'rb_thread_select'; did you mean 'rb_thread_fd_select'?
if ((ret = rb_thread_select(kqfd + 1, &fdreads, NULL, NULL, &tv)) < 1) {
^~~~~~~~~~~~~~~~
rb_thread_fd_select
/Users/userName/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/intern.h:454:5: note: 'rb_thread_fd_select' declared here
int rb_thread_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *);
^
em.cpp:706:40: error: cannot initialize a parameter of type 'rb_fdset_t *' with an rvalue of type 'fd_set *'
if ((ret = rb_thread_select(kqfd + 1, &fdreads, NULL, NULL, &tv)) < 1) {
^~~~~~~~
/Users/userName/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/intern.h:454:42: note: passing argument to parameter here
int rb_thread_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *);
^
2 errors generated.
make: *** [em.o] Error 1
make failed, exit code 2
宝石文件
source 'https://rubygems.org'
ruby '2.2.2'
gem 'json' # JSON
gem 'foreman' # Process management
gem 'racksh'
gem 'thin'
gem 'rack-cors', :require => 'rack/cors'
gem 'sprockets'
gem 'rake'
# Formatting
gem 'nokogiri'
gem 'chronic'
gem 'htmlentities', '~> 4.3', '>= 4.3.4'
# DB
gem 'pg'
gem 'activerecord', '~> 5.0.0' # Database
gem 'redis', '~>3.2'
# API Framework
gem 'grape'
group :development do
gem 'rb-readline'
gem 'rerun'
gem 'mina' # Deployment
end
group :test do
gem 'test-unit'
gem "rack-test", require: "rack/test"
gem 'test_xml'
gem 'bogus'
gem 'database_cleaner'
gem 'timecop'
end
group :development, :test do
gem 'awesome_print'
gem 'pry'
end
我尝试了以下方法来解决这个问题。
酿造链接 openssql --force
Warning: Refusing to link macOS provided/shadowed software: openssl@1.1
If you need to have openssl@1.1 first in your PATH, run:
echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> /Users/userName/.bash_profile
For compilers to find openssl@1.1 you may need to set:
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
For pkg-config to find openssl@1.1 you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig"
.base_profile
#..
export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig"
但结果是一样的
gem install eventmachine -- --with-cppflags=-I/usr/local/opt/openssl/include
宝石安装事件机器--pre
捆绑更新事件机
在 Gemfile 添加“gem 'eventmachine', '=1.0.3'”
在 Gemfile 中更改“gem 'eventmachine', '=1.0.4'”
在 Gemfile 更改“gem 'eventmachine', '~>1.0.4'”
我怎么解决这个问题?
我为 Mac Catalina 10.15.6 工作
解决方案
推荐阅读
- swift - 如何让继承作用于闭包内的参数?
- sql - 计算订阅者的调用频率 SQL Netezza
- mysql - mysql db的分片配置
- python - Python SpeechRecognition 逐字逐句?连续输出?
- c - 使用 << 和 + 重写 C 表达式
- javascript - 如何使用外部js文件在表单提交上调用函数
- java - 如何在 Java 中将 RGB 颜色转换为十六进制
- bash - Grep方法删除文件中与其他文件中的任何行匹配的所有行?
- perl - 根据 perl 中的标题对 CSV 列值进行排序
- node.js - 对node.js服务器的axios请求不返回数据