从 3.1.1 升级到 3.2.0 失败

已通过 Web 和 CLI 尝试。日志显示:

要查看此扩展名为何编译失败,请检查 mkmf.log,它可以在以下位置找到:

/var/www/discourse/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/rbtrace-0.5.1/mkmf.log

但我甚至在我的 discourse 文件夹中没有“vendor”文件夹?!

升级尝试使我处于无法正常工作的状态,而“./discourse-doctor”能够修复它。

有什么办法可以解决这个问题吗?

完整日志(问题开始出现的地方)

I, [2024-01-31T20:09:59.830751 #1]  INFO -- : cd /var/www/discourse & su discourse -c 'bundle config --local deployment true'
I, [2024-01-31T20:10:00.523559 #1]  INFO -- :
I, [2024-01-31T20:10:00.524352 #1]  INFO -- : cd /var/www/discourse & su discourse -c 'bundle config --local without "development test"'
I, [2024-01-31T20:10:00.865136 #1]  INFO -- : You are replacing the current local value of without, which is currently "test:development"

I, [2024-01-31T20:10:00.865950 #1]  INFO -- : cd /var/www/discourse & su discourse -c 'bundle install --retry 3 --jobs 4'
**Gem::Ext::BuildError: ERROR: Failed to build gem native extension.**

current directory:
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rbtrace-0.5.1/ext
/usr/local/bin/ruby extconf.rb
  -- tar zxvfo msgpack-1.1.0.tar.gz
  -- env CFLAGS=nil LDFLAGS=nil CC=nil
-- ./configure --disable-dependency-tracking --disable-shared --with-pic
--prefix=/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rbtrace-0.5.1/ext/dst/
--libdir=/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rbtrace-0.5.1/ext/dst/lib
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/local/bin/$(RUBY_BASE_NAME)extconf.rb:6:in `sys': ./configure --disable-dependency-tracking
--disable-shared --with-pic
--prefix=/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rbtrace-0.5.1/ext/dst/
--libdir=/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rbtrace-0.5.1/ext/dst/lib
failed, please report to https://github.com/tmm1/rbtrace/issues (RuntimeError)
        from extconf.rb:42:in `block (2 levels) in <main>'
        from extconf.rb:34:in `chdir'
        from extconf.rb:34:in `block in <main>'
        from extconf.rb:30:in `chdir'
        from extconf.rb:30:in `<main>'

**To see why this extension failed to compile, please check the mkmf.log which can**
**be found here:**

**/var/www/discourse/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/rbtrace-0.5.1/mkmf.log**

extconf failed, exit code 1

Gem files will remain installed in
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rbtrace-0.5.1 for inspection.
Results logged to
/var/www/discourse/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/rbtrace-0.5.1/gem_make.out

  /usr/local/lib/ruby/site_ruby/3.2.0/rubygems/ext/builder.rb:125:in `run'
/usr/local/lib/ruby/site_ruby/3.2.0/rubygems/ext/ext_conf_builder.rb:28:in
`build'
/usr/local/lib/ruby/site_ruby/3.2.0/rubygems/ext/builder.rb:193:in
`build_extension'
/usr/local/lib/ruby/site_ruby/3.2.0/rubygems/ext/builder.rb:227:in `block in
build_extensions'
  /usr/local/lib/ruby/site_ruby/3.2.0/rubygems/ext/builder.rb:224:in `each'
/usr/local/lib/ruby/site_ruby/3.2.0/rubygems/ext/builder.rb:224:in
`build_extensions'
/usr/local/lib/ruby/site_ruby/3.2.0/rubygems/installer.rb:852:in
`build_extensions'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/rubygems_gem_installer.rb:76:in
`build_extensions'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/rubygems_gem_installer.rb:28:in
`install'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/source/rubygems.rb:205:in
`install'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/installer/gem_installer.rb:54:in
`install'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/installer/gem_installer.rb:16:in
`install_from_spec'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/installer/parallel_installer.rb:132:in
`do_install'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/installer/parallel_installer.rb:123:in
`block in worker_pool'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/worker.rb:62:in
`apply_func'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/worker.rb:57:in
`block in process_queue'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/worker.rb:54:in
`loop'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/worker.rb:54:in
`process_queue'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/worker.rb:90:in
`block (2 levels) in create_threads'

An error occurred while installing rbtrace (0.5.1), and Bundler cannot continue.

In Gemfile:
  rbtrace
I, [2024-01-31T20:10:51.337197 #1]  INFO -- : Fetching gem metadata from https://rubygems.org/.........
Fetching concurrent-ruby 1.2.3
Fetching minitest 5.21.2
Fetching bigdecimal 3.1.6
Fetching cbor 0.5.9.8
Installing bigdecimal 3.1.6 with native extensions
Installing cbor 0.5.9.8 with native extensions
Installing minitest 5.21.2
Installing concurrent-ruby 1.2.3
Fetching excon 0.109.0
Installing excon 0.109.0
Fetching fastimage 2.3.0
Installing fastimage 2.3.0
Fetching google-protobuf 3.25.2 (x86_64-linux)
Fetching highline 3.0.1
Installing highline 3.0.1
Installing google-protobuf 3.25.2 (x86_64-linux)
Fetching image_size 3.4.0
Installing image_size 3.4.0
Fetching regexp_parser 2.9.0
Fetching logster 2.16.0
Installing regexp_parser 2.9.0
Installing logster 2.16.0
Fetching stackprof 0.2.26
Installing stackprof 0.2.26 with native extensions
Fetching nokogiri 1.16.0 (x86_64-linux)
Installing nokogiri 1.16.0 (x86_64-linux)
Fetching rack-protection 3.2.0
Installing rack-protection 3.2.0
Fetching bootsnap 1.17.1
Installing bootsnap 1.17.1 with native extensions
Fetching net-http 0.4.1
Installing net-http 0.4.1
Fetching sass-embedded 1.70.0 (x86_64-linux-gnu)
Installing sass-embedded 1.70.0 (x86_64-linux-gnu)
Fetching puma 6.4.2
Installing puma 6.4.2 with native extensions
Fetching rbtrace 0.5.1
Installing rbtrace 0.5.1 with native extensions
Fetching net-imap 0.4.9.1
Installing net-imap 0.4.9.1
Fetching net-smtp 0.4.0.1
Installing net-smtp 0.4.0.1
Fetching faraday-net_http 3.1.0
Installing faraday-net_http 3.1.0
Fetching activesupport 7.0.8
Installing activesupport 7.0.8
Fetching tzinfo-data 1.2023.4
Installing tzinfo-data 1.2023.4
Fetching sassc-embedded 1.70.0
Installing sassc-embedded 1.70.0
Fetching faraday 2.9.0
Installing faraday 2.9.0
Fetching activemodel 7.0.8
Installing activemodel 7.0.8
Fetching actionview 7.0.8
Installing actionview 7.0.8
Fetching activejob 7.0.8
Installing activejob 7.0.8
Fetching activerecord 7.0.8
Installing activerecord 7.0.8
Fetching actionpack 7.0.8
Installing actionpack 7.0.8
Fetching actionmailer 7.0.8
Installing actionmailer 7.0.8
Fetching railties 7.0.8
Installing railties 7.0.8

I, [2024-01-31T20:10:51.488182 #1]  INFO -- : Terminating async processes
I, [2024-01-31T20:10:51.493415 #1]  INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/13/bin/postmaster -D /etc/postgresql/13/main pid: 40
2024-01-31 20:10:51.502 UTC [40] LOG:  received fast shutdown request
I, [2024-01-31T20:10:51.502920 #1]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 109
109:signal-handler (1706731851) Received SIGTERM scheduling shutdown...
109:M 31 Jan 2024 20:10:51.704 # User requested shutdown...
109:M 31 Jan 2024 20:10:51.705 * Saving the final RDB snapshot before exiting.
2024-01-31 20:10:51.746 UTC [40] LOG:  aborting any active transactions
2024-01-31 20:10:51.750 UTC [40] LOG:  background worker "logical replication launcher" (PID 49) exited with exit code 1
2024-01-31 20:10:51.755 UTC [44] LOG:  shutting down
109:M 31 Jan 2024 20:10:52.025 * DB saved on disk
109:M 31 Jan 2024 20:10:52.034 # Redis is now ready to exit, bye bye...
2024-01-31 20:10:52.197 UTC [40] LOG:  database system is shut down


FAILED
--------------------
Pups::ExecError: cd /var/www/discourse & su discourse -c 'bundle install --retry 3 --jobs 4' failed with return #<Process::Status: pid 530 exit 5>
Location of failure: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle config --local deployment true'", "su discourse -c 'bundle config --local without \"development test\"'", "su discourse -c 'bundle install --retry 3 --jobs 4'"]}
bootstrap failed with exit code 5
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.
ee1a50a433805c35ab598cc057cff207f009de0abcc8176fdf0964a75a5f4b72
root@hockeyrock:/var/discourse#

您有非官方插件吗?

cat /etc/issue 显示了您当前的操作系统是什么?它是否仍然受支持?

2 个赞

仅启用了单个插件:discourse-adplugin v1.2.5

操作系统:Ubuntu 16.04.7 LTS <= 我猜这就是问题所在。我将更新它,看看会发生什么。

Paul

啊,找到了关键。关于这个现在已经有很多主题了。

确实,rbtrace 似乎无法在旧系统上编译。

1 个赞