簡體   English   中英

nio4r gem 無法使用本機擴展構建(嘗試安裝 redmine_knowledgebase 插件)

[英]nio4r gem failed to build with native extensions (trying to install redmine_knowledgebase plugin)

從 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。 Bundler 安裝的任何平台都不會使用依賴項 ffi (>= 0)。 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)在 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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM