-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Factory Bot 6.4.5: Syntax error with Ruby < 2.7, but the ruby gem requirement is still >= 2.5.0
#1614
Comments
Just ran into this myself, it appears due to 36bd065 . |
I just ran into this on a JRuby 9.3 project (2.6 parser). |
thoughtbot/factory_bot#1614 This version introduced a breaking change for Ruby 2 when trying to add Ruby 3 compatibility (and it didn't note that it was no longer compatible with ruby 2). Pinning for now, but should be able to be removed if they jank the version and release new versions with a requirement on Ruby 3+
thoughtbot/factory_bot#1614 This version introduced a breaking change for Ruby 2 when trying to add Ruby 3 compatibility (and it didn't note that it was no longer compatible with ruby 2). Pinning for now, but should be able to be removed if they jank the version and release new versions with a requirement on Ruby 3+
Whilst this release is good and has come out. It's now breaking some CI stuff in cucumber-rails. Did the decision to yank ever get done? I appreciate it's likely low priority but thought I'd ask incase I can avoid doing the work there. |
If cucumber-rails supports an EOL'ed Ruby version, then it needs to lock its dependencies to the last version that supports that now-unsupported Ruby. |
I am running into this with ruby "2.7.2" |
My rails engine is on ruby version Failure/Error: require 'factory_bot'
SyntaxError:
/Users/xxx/.rvm/gems/ruby-2.7.2/gems/factory_bot-6.4.5/lib/factory_bot/evaluator.rb:38: syntax error, unexpected (...
...method_missing(method_name, ...)
... ^~~
/Users/xxx/.rvm/gems/ruby-2.7.2/gems/factory_bot-6.4.5/lib/factory_bot/evaluator.rb:40: syntax error, unexpected ')'
...instance.send(method_name, ...)
... ^
/Users/xxx/.rvm/gems/ruby-2.7.2/gems/factory_bot-6.4.5/lib/factory_bot/evaluator.rb:42: syntax error, unexpected ')'
...nner.new.send(method_name, ...)
... ^
/Users/xxx/.rvm/gems/ruby-2.7.2/gems/factory_bot-6.4.5/lib/factory_bot/evaluator.rb:80: syntax error, unexpected end-of-input, expecting `end' I also needed to downgrade to s.add_development_dependency 'factory_bot', '6.4.4' to get rid of the error. |
You can clearly see @ryabrody - You're using ruby 2.7 in your stacktrace. The solution is to use the latest version on 3.0 or 6.4.4 |
It works for me: gem 'factory_bot', '!= 6.4.5' |
Since factory bot doesn't support it anymore thoughtbot/factory_bot#1614
Since factory bot doesn't support it anymore thoughtbot/factory_bot#1614
Since factory bot doesn't support it anymore thoughtbot/factory_bot#1614
Since factory bot doesn't support it anymore thoughtbot/factory_bot#1614
Ruby version 3.0.3 worked for me |
I am currently in the process of upgrading from Ruby 2.6 to Ruby 3.0. Initially, I didn't find any restrictions on updating my current factory_bot_rails version to the latest one. Unfortunately, this turned out to be incorrect. The latest version of factory_bot_rails requires factory_bot v6.4, which in turn requires Ruby 3, causing my update to fail. ``` SyntaxError: /root/project/vendor/bundle/ruby/2.6.0/gems/factory_bot-6.4.5/lib/factory_bot/evaluator.rb:38: syntax error, unexpected ... ...method_missing(method_name, ...) ``` So, adding the `required_ruby_version` might help to prevent the misconception. References: - thoughtbot/factory_bot#1614 - thoughtbot/factory_bot@36bd065 - https://github.com/thoughtbot/factory_bot/pull/1622/files
They were dropped from CI in thoughtbot#1612. Also see thoughtbot#1614 and 1622
Description
Factory Bot 6.4.5 contains syntax which is not compatible with Ruby < 2.7, but the ruby gem requirement is still
>= 2.5.0
Probably introduced in: #1612
I understand that the intent is to drop Ruby < 3.0, but the requirement in the Gemfile was not updated accordingly.
I would suggest to yank 6.4.5 and release 6.4.6 with the minimum ruby version at 3.0
Ref:
Reproduction Steps
Run the following script:
Expected behavior
No raise
Actual behavior
System configuration
factory_bot version: 6.4.5
rails version: n/a
ruby version: 2.6.10, 2.5.9
The text was updated successfully, but these errors were encountered: