crest-cassia / oacis

http://crest-cassia.github.io/oacis/
46 stars 9 forks source link

Rubyバージョンを上げられるかの調査(best effort) #735

Closed morimorihoge closed 3 years ago

morimorihoge commented 3 years ago

現在

という状態だが、整理した方がいいかもしれないということで、best effortで見てみる。

TODO(いけるところまで)

kimurabps commented 3 years ago

738 より転載

Ruby 3.0 バージョンアップ検証

bundle install 中に発生したエラー

minitest 5.13.0がRuby 3.0に対応してない

minitest-5.13.0 requires ruby version ~> 2.2, which is incompatible with the
current version, ruby 3.0.0p0

→ minitestを5.14.4に上げることで解決

core.ioのインストール中に fatal error: rubyio.h: No such file or directory のエラーが発生

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/home/oacis/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/cool.io-1.4.6/ext/cool.io
/home/oacis/.rbenv/versions/3.0.0/bin/ruby -I
/home/oacis/.rbenv/versions/3.0.0/lib/ruby/3.0.0 -r
./siteconf20210225-12566-7msvr6.rb extconf.rb
checking for rb_thread_blocking_region()... no
checking for rb_thread_call_without_gvl()... yes
checking for rb_thread_alone()... yes
checking for rb_str_set_len()... yes
checking for clock_gettime() in -lrt... yes
checking for sys/select.h... yes
checking for poll.h... yes
checking for sys/epoll.h... yes
checking for sys/event.h... no
checking for port.h... no
checking for sys/resource.h... yes
creating Makefile

current directory:
/home/oacis/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/cool.io-1.4.6/ext/cool.io
make "DESTDIR=" clean

current directory:
/home/oacis/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/cool.io-1.4.6/ext/cool.io
make "DESTDIR="
compiling cool.io_ext.c
In file included from cool.io_ext.c:11:0:
cool.io.h:11:20: fatal error: rubyio.h: No such file or directory
 #include "rubyio.h"
                    ^
compilation terminated.
Makefile:244: recipe for target 'cool.io_ext.o' failed
make: *** [cool.io_ext.o] Error 1

make failed, exit code 2

Gem files will remain installed in
/home/oacis/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/cool.io-1.4.6 for
inspection.
Results logged to
/home/oacis/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/extensions/x86_64-linux/3.0.0/cool.io-1.4.6/gem_make.out

An error occurred while installing cool.io (1.4.6), and Bundler cannot continue.
Make sure that `gem install cool.io -v '1.4.6' --source 'https://rubygems.org/'`
succeeds before bundling.

In Gemfile:
  msgpack-rpc was resolved to 0.5.4, which depends on
    cool.io

https://github.com/ruby/ruby/pull/3344 の対応でrubyio.hが削除されてしまった様子。 msgpack-rpc 0.5.4は cool.io (~> 1.4.3) に依存しており、cool.ioは 1.4.6 までしか上げられない。(上記の問題を解決するには 1.6.1 に上げる必要がある) msgpack-rpcをアップデートしてみようと思ったが、このgemは以下にforkして使っているようなので色々と修正が必要そう。 https://github.com/yohm/msgpack-rpc-ruby

Rails起動中に発生したエラー

mongoidでdelegateメソッドがエラーになる

rake aborted!
ArgumentError: Delegation needs a target. Supply an options hash with a :to key as the last argument (e.g. delegate :hello, to: :greeter).
/home/oacis/oacis/config/application.rb:18:in `<top (required)>'
/home/oacis/oacis/rakefile:5:in `require'
/home/oacis/oacis/rakefile:5:in `<top (required)>'
/home/oacis/.rbenv/versions/3.0.0/bin/bundle:23:in `load'
/home/oacis/.rbenv/versions/3.0.0/bin/bundle:23:in `<main>'
(See full trace by running task with --trace)

→ mongoidのgemを7.2.1にアップデートすることで解決

Ruby 3.0のキーワード引数変更の影響によるエラーが発生

/home/oacis/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/actionpack-5.2.4.1/lib/action_dispatch/middleware/static.rb:111:in `initialize': wrong number of arguments (given 3, expected 2) (ArgumentError)

→ Railsを6にアップグレードする必要がある。

Rails 6 + Sprockets 4に上げるとdynatree-railsでエラーが発生

sprockets 4に上げると #692 で報告されているように、SassC::SyntaxError in Simulators#index のエラーが発生してしまう。 dynatree-railsをアップデートしようと思ったが、もうメンテされていない様子。 SprocketsをやめてWebpackerに移行した方がよさそう(?)

morimorihoge commented 3 years ago

定例にて完了確認とれましたのでcloseします。