お
Ruby 3.3.0-rc1 Released
https://www.ruby-lang.org/en/news/2023/12/11/ruby-3-3-0-rc1-released/
$ git -C ~/.rbenv/plugins/ruby-build pull
$ rbenv install 3.3.0-rc1
ファンぶーん
$ rbenv local 3.3.0-rc1
$ bundle install
$ bundle exec rails assets:precompile
bin/rails aborted!
ArgumentError: comparison of String with nil failed (ArgumentError)
msg = " #{RUBY_VERSION < SINCE[gem] ? "will no longer be" : "is not"} part of the default gems since Ruby #{SINCE[gem]}."
^^^^^^^^^^
/home/zunda/c/src/github.com/zunda/mastodon/vendor/bundle/ruby/3.3.0+0/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
:
ふーむ
$ cd ~/.rbenv/versions/3.3.0-rc1/
$ grep -r 'part of the default gems since Ruby'
lib/ruby/3.3.0+0/bundled_gems.rb: msg = " #{RUBY_VERSION < SINCE[gem] ? "will no longer be" : "is not"} part of the default gems since Ruby #{SINCE[gem]}."
SINCEはbundled_gems.rbで定義されているのでbootsnapが追い付けてないんだなきっと
$ cd ~/.rbenv/versions
$ diff -u 3.3.0-{preview3,rc1}/lib/ruby/3.3.0+0/bundled_gems.rb
してもそれほど大きな変化は見えないような気もする。
Gemfileからpreview3対応を取り除いたらエラーが変化した気もするな…
diff --git a/Gemfile b/Gemfile
index bbba833f43..1ade3a91fd 100644
--- a/Gemfile
+++ b/Gemfile
@@ -2,9 +2,7 @@
source 'https://rubygems.org'
-::RUBY_DESCRIPTION = Object.send(:remove_const, :RUBY_DESCRIPTION).sub(/dev/, 'preview3')
-Gem.remove_instance_variable(:@ruby_version) if Gem.instance_variable_defined?(:@ruby_version)
-ruby '3.3.0.preview3'
+ruby '3.3.0.rc1'
gem 'puma', '~> 6.3'
gem 'rails', '~> 7.1.1'
$ bundle install
は完走するようになった。
$ RAILS_ENV=test bundle exec rspec
はいくつか./vendor/bundle/ruby/3.3.0+0/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'のcomparison of String with nil failedで落ちる。
./vendor/bundle/ruby/3.3.0+0/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rbの最初で
module Kernel
module_function
alias_method(:require_without_bootsnap, :require)
とたぶん普通のrequireエイリアスしていて、それを
# Note that require registers to $LOADED_FEATURES while load does not.
ret = require_without_bootsnap(resolved)
Bootsnap::LoadPathCache.loaded_features_index.register(string_path, resolved)
return ret
で呼んでいて、あー、diff -u 3.3.0-{preview3,rc1}/lib/ruby/3.3.0+0/bundled_gems.rbするとself.replace_requireちゅうのが新しく定義されてるんだねえ。
ナンモワカランのでruby-jp Slackのrubyチャンネルに放り投げました。お騒がせします。
$ DISABLE_BOOTSNAP=1 RAILS_ENV=test bundle exec rails assets:precompile
/home/zunda/c/src/github.com/zunda/mastodon/vendor/bundle/ruby/3.3.0+0/gems/mail-2.8.1/lib/mail.rb:9: warning: net/smtp was loaded from the standard library, but is not part of the default gems since Ruby 3.1.0. Add net-smtp to your Gemfile or gemspec.
/home/zunda/.rbenv/versions/3.3.0-rc1/lib/ruby/3.3.0+0/drb.rb:2: warning: drb/drb is found in drb, which will no longer be part of the default gems since Ruby 3.4.0. Add drb to your Gemfile or gemspec.
Compiling...
Compiled all packs in /home/zunda/c/src/github.com/zunda/mastodon/public/packs-test
お
$ DISABLE_BOOTSNAP=1 RAILS_ENV=test bundle exec rspec
/home/zunda/c/src/github.com/zunda/mastodon/vendor/bundle/ruby/3.3.0+0/gems/mail-2.8.1/lib/mail.rb:9: warning: net/smtp was loaded from the standard library, but is not part of the default gems since Ruby 3.1.0. Add net-smtp to your Gemfile or gemspec.
/home/zunda/.rbenv/versions/3.3.0-rc1/lib/ruby/3.3.0+0/drb.rb:2: warning: drb/drb is found in drb, which will no longer be part of the default gems since Ruby 3.4.0. Add drb to your Gemfile or gemspec.
/home/zunda/c/src/github.com/zunda/mastodon/vendor/bundle/ruby/3.3.0+0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38: warning: csv was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add csv to your Gemfile or gemspec.
Run options: exclude {:search=>true, :type=>#<Proc: ./spec/rails_helper.rb:53>}
:
し
Finished in 10 minutes 57 seconds (files took 27.12 seconds to load)
5615 examples, 1 failure, 78 pending
Failed examples:
rspec ./spec/lib/request_pool_spec.rb:31 # RequestPool#with grows to the number of threads accessing it
Randomized with seed 17820
Coverage report generated for RSpec to /home/zunda/c/src/github.com/zunda/mastodon/coverage. 24182 / 27664 LOC (87.41%) covered.
Stopped processing SimpleCov as a previous error not related to SimpleCov has been detected
ん?
$ DISABLE_BOOTSNAP=1 RAILS_ENV=test bundle exec rspec ./spec/lib/request_pool_spec.rb:31
:
Finished in 1.37 seconds (files took 13.94 seconds to load)
1 example, 0 failures
ほむ
remote: -----> Detecting rake tasks
remote:
remote: !
remote: ! Could not detect rake tasks
remote: ! ensure you can run `$ bundle exec rake -P` against your app
remote: ! and using the production group of your Gemfile.
remote: ! rake aborted!
remote: ! ArgumentError: comparison of String with nil failed (ArgumentError)
remote: !
remote: ! msg = " #{RUBY_VERSION < SINCE[gem] ? "will no longer be" : "is not"} part of the default gems since Ruby #{SINCE[gem]}."
remote: ! ^^^^^^^^^^
remote: ! /tmp/build_a965385f/vendor/ruby-3.3.0.rc1/lib/ruby/3.3.0+0/bundled_gems.rb:120:in `<'
くっそーw
DISABLE_BOOTSNAP=1 config varを関連Herokuアプリに設定してみますね。てかどうせキャシュ効かないよなあ…
ビルドプロセスには効かないんだっけ…んなことないはずだよなあ…
Gemfileなどからbootsnap消してみました
remote: -----> Using Ruby version: ruby-3.3.0.rc1
remote: Ruby version change detected. Clearing bundler cache.
remote: Old: ruby 3.3.0dev (2023-11-12 master 60e19a0b5f) [x86_64-linux]
remote: New: ruby 3.3.0rc1 (2023-12-11 master a49643340e) [x86_64-linux]