如何解决nio4r gem 无法使用本机扩展构建尝试安装 redmine_knowledgebase 插件
从 Ubuntu 服务器 20.04 上的最新 Linux bitnami 安装程序 (4.2) 下载并安装 Redmine。 安装没有问题,redmine 已启动并正常运行:
Redmine version 4.2.0.stable
Ruby version 2.5.8-p224 (2020-03-31) [x86_64-linux]
Rails version 5.2.5
Environment production
Database adapter Mysql2
但是,当我尝试安装知识库插件时,nio4r gem 出现编译器构建错误:
bruno@Vostro:~/redmine-4.1.1-8/apps/redmine/htdocs/plugins$ git clone git://github.com/alexbevi/redmine_knowledgebase.git
bundle install --no-deployment
依赖 tzinfo-data (>= 0) 将不会被 Bundler 安装的任何平台使用。 Bundler 正在为 ruby 安装,但依赖项仅适用于 x86-mingw32、x64-mingw32、x86-mswin32。要将这些平台添加到包中,请运行 bundle lock --add-platform x86-mingw32 x64-mingw32 x86-mswin32。 依赖 ffi (>= 0) 将不会被 Bundler 安装的任何平台使用。 Bundler 正在为 ruby 安装,但依赖项仅适用于 x86-mingw32、x64-mingw32、x86-mswin32。要将这些平台添加到包中,请运行 bundle lock --add-platform x86-mingw32 x64-mingw32 x86-mswin32。
Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies.....
Fetching rake 13.0.3
Installing rake 13.0.3
Fetching concurrent-ruby 1.1.8
Installing concurrent-ruby 1.1.8
Fetching i18n 1.8.9
Installing i18n 1.8.9
Fetching minitest 5.14.4
Installing minitest 5.14.4
Using thread_safe 0.3.6
Fetching tzinfo 1.2.9
Installing tzinfo 1.2.9
Fetching activesupport 5.2.5
Installing activesupport 5.2.5
Using builder 3.2.4
Fetching erubi 1.10.0
Installing erubi 1.10.0
Fetching mini_portile2 2.5.0
Installing mini_portile2 2.5.0
Fetching racc 1.5.2
Installing racc 1.5.2 with native extensions
Fetching nokogiri 1.11.2 (x86_64-linux)
Installing nokogiri 1.11.2 (x86_64-linux)
Using rails-dom-testing 2.0.3
Using crass 1.0.6
Fetching loofah 2.9.0
Installing loofah 2.9.0
Using rails-html-sanitizer 1.3.0
Fetching actionview 5.2.5
Installing actionview 5.2.5
Using rack 2.2.3
Fetching rack-test 1.1.0
Installing rack-test 1.1.0
Fetching actionpack 5.2.5
Installing actionpack 5.2.5
Fetching nio4r 2.5.7
Installing nio4r 2.5.7 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /home/bruno/redmine-4.2.0-0/ruby/lib/ruby/gems/2.5.0/gems/nio4r-2.5.7/ext/nio4r
/home/bruno/redmine-4.2.0-0/ruby/bin/ruby -r ./siteconf20210329-18642-1yfhj63.rb extconf.rb
checking for unistd.h... yes
checking for linux/aio_abi.h... yes
checking for linux/io_uring.h... yes
checking for sys/select.h... yes
checking for port_event_t in poll.h... no
checking for sys/epoll.h... yes
checking for sys/event.h... no
checking for port_event_t in port.h... no
checking for sys/resource.h... yes
creating Makefile
current directory: /home/bruno/redmine-4.2.0-0/ruby/lib/ruby/gems/2.5.0/gems/nio4r-2.5.7/ext/nio4r
make "DESTDIR=" clean
current directory: /home/bruno/redmine-4.2.0-0/ruby/lib/ruby/gems/2.5.0/gems/nio4r-2.5.7/ext/nio4r
make "DESTDIR="
compiling bytebuffer.c
compiling monitor.c
compiling nio4r_ext.c
In file included from nio4r_ext.c:6:
../libev/ev.c:2136:31: warning: ‘ev_default_loop_ptr’ initialized and declared ‘extern’
2136 | EV_API_DECL struct ev_loop ev_default_loop_ptr = 0; / needs to be initialised to make it a definition
despite extern */
| ^~~~~~~~~~~~~~~~~~~
../libev/ev.c: In function ‘ev_time’:
../libev/ev.c:2172:7: internal compiler error: Illegal instruction
2172 | return EV_TS_GET (ts);
| ^~~~~~
Please submit a full bug report,with preprocessed source if appropriate.
See for instructions.
make: *** [Makefile:243: nio4r_ext.o] Error 1
make failed,exit code 2
Gem files will remain installed in /home/bruno/redmine-4.2.0-0/ruby/lib/ruby/gems/2.5.0/gems/nio4r-2.5.7 for
inspection.
Results logged to
/home/bruno/redmine-4.2.0-0/ruby/lib/ruby/gems/2.5.0/extensions/x86_64-linux/2.5.0-static/nio4r-2.5.7/gem_make.out_
An error occurred while installing nio4r (2.5.7),and Bundler cannot continue.
Make sure that gem install nio4r -v '2.5.7' --source 'https://rubygems.org/' succeeds before bundling.
In Gemfile:
redmine_crm was resolved to 0.0.54,which depends on
rails was resolved to 5.2.5,which depends on
actioncable was resolved to 5.2.5,which depends on nio4r
在捆绑之前尝试直接安装 gem nio4r 时,同样的编译器构建错误:
gem install nio4r -v '2.5.7' --source 'https://rubygems.org/'
.../gems/2.5.0/extensions/x86_64-linux/2.5.0-static/nio4r-2.5.7/mkmf.log 错误日志:
...
conftest.c:6:9: error: unknown type name ‘port_event_t’
...
conftest.c:3:10: fatal error: sys/event.h: No such file or directory
...
conftest.c:3:10: fatal error: port.h: No such file or directory
...
任何见解? 谢谢
解决方法
在加载 Bitnami 控制台后,我已经能够使用 Bitnami Redmine 4.1.X(知识库插件不正式支持 Redmine 4.2)和插件的 installation’s commands 在新的 Ubuntu 20 实例中安装该插件。您能否按照以下命令尝试安装插件:
cd INSTALLDIR
./use_redmine
. ./scripts/setenv.sh
cd apps/redmine/htdocs/
bundle install
bundle exec ./bin/rake redmine:plugins:migrate NAME=redmine_knowledgebase RAILS_ENV=production
INSTALLDIR/ctlscript.sh restart
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。