rails / webpacker

Use Webpack to manage app-like JavaScript modules in Rails
MIT License
5.31k stars 1.47k forks source link

Incompatibility with Ruby 3.2.0 #3299

Closed wkdewey closed 1 year ago

wkdewey commented 1 year ago

Ruby version: 3.2.0 Rails version: 6.1.7 Webpacker version: 5.4.3

Expected behavior: When I run rails webpacker:install (or rails new appname which runs the preceding command), it should do all the webpacker installation. Actual behavior: It gives an error

rails aborted!
NoMethodError: undefined method `exists?' for Dir:Class
~/rails6testapp/gemfile-review/bin/rails:5:in `<top (required)>'
~/rails6testapp/gemfile-review/bin/spring:10:in `require'
~/rails6testapp/gemfile-review/bin/spring:10:in `block in <top (required)>'
~s/rails6testapp/gemfile-review/bin/spring:7:in `<top (required)>'

See https://www.ruby-lang.org/en/news/2022/12/25/ruby-3-2-0-released/ Small, reproducible repo: set .ruby-version to 3.2.0, make a new gemset in .ruby-gemset, and generate a new rails app (making sure to use Rails 6, maybe this is fixed in Rails 7).

MSP-Greg commented 1 year ago

See merged https://github.com/rails/webpacker/pull/3250

yahonda commented 1 year ago

This issue has been resolved via https://github.com/rails/webpacker/pull/3306 and webpacker 5.4.4 has been released including https://github.com/rails/webpacker/pull/3306

https://github.com/rails/webpacker/blob/5-x-stable/CHANGELOG.md#544---2023-01-31