Skip to content
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

rubocop-ast release made rubocop 1.6.1 require ruby 2.5.0 #9768

Closed
mmb opened this issue May 3, 2021 · 4 comments
Closed

rubocop-ast release made rubocop 1.6.1 require ruby 2.5.0 #9768

mmb opened this issue May 3, 2021 · 4 comments

Comments

@mmb
Copy link

mmb commented May 3, 2021

rubocop version 1.6.1 has dependency constraint:

rubocop-ast >= 1.2.0, < 2.0

The recent releases of rubocop-ast (1.4.2 and 1.5.0) satisfy these constraints so they introduce a dependency on ruby version >= 2.5.0. This breaks rubocop version 1.6.1 on ruby 2.4.


Expected behavior

It's unexpected that released versions of rubocop would change their ruby version requirements. Should a ruby version bump in rubocop-ast be treated as a major version?

Actual behavior

$ ruby -v
ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin19]
$ gem install rubocop -v 1.6.1
Fetching: parser-3.0.1.1.gem (100%)
Successfully installed parser-3.0.1.1
Fetching: rubocop-ast-1.5.0.gem (100%)
ERROR:  Error installing rubocop:
	rubocop-ast requires Ruby version >= 2.5.0.

Steps to reproduce the problem

Install rubocop version 1.6.1 when using ruby 2.4.2.

RuboCop version

@bbatsov
Copy link
Collaborator

bbatsov commented May 4, 2021

Should a ruby version bump in rubocop-ast be treated as a major version?

We discussed the subject here for RuboCop #9648, but I guess we didn't consider the impact for rubocop-ast.

@bbatsov
Copy link
Collaborator

bbatsov commented May 4, 2021

Just to be clear - our expectations was that in a case like yours you'd the get the news version of rubocop-ast that's installable on Ruby 2.4. I'm not sure why that's not actually happening.

@marcandre
Copy link
Contributor

Sorry you're having issues.

Indeed, it shouldn't be breaking.

This may be a bug in the rubygems you are using that has been fixed? Could you try gem update --system first?

I was able to install rubocop both 1.12.1 and 1.6.1 on Ruby 2.4.10 with:

$ gem update --system
[...]
$ gem install rubocop
Fetching rexml-3.2.5.gem
Fetching unicode-display_width-2.0.0.gem
Fetching ruby-progressbar-1.11.0.gem
Fetching parser-3.0.1.1.gem
Fetching rubocop-ast-1.4.1.gem
Fetching rubocop-1.12.1.gem
Fetching rainbow-3.0.0.gem
Fetching parallel-1.20.1.gem
Fetching regexp_parser-2.1.1.gem
Successfully installed unicode-display_width-2.0.0
Successfully installed ruby-progressbar-1.11.0
Successfully installed parser-3.0.1.1
Successfully installed rubocop-ast-1.4.1
Successfully installed rexml-3.2.5
Successfully installed regexp_parser-2.1.1
Successfully installed rainbow-3.0.0
Successfully installed parallel-1.20.1
Successfully installed rubocop-1.12.1
9 gems installed
$ gem install rubocop -v 1.6.1
Fetching rubocop-1.6.1.gem
Fetching unicode-display_width-1.7.0.gem
Successfully installed unicode-display_width-1.7.0
Successfully installed rubocop-1.6.1
2 gems installed
$ ruby -v
ruby 2.4.10p364 (2020-03-31 revision 67879) [x86_64-darwin18]

@mmb
Copy link
Author

mmb commented May 4, 2021

gem update --system does fix it. Thanks for the responses.

docker run -it ruby:2.4.10 bash
gem install rubocop -v 1.6.1
ERROR:  Error installing rubocop:
	The last version of rubocop-ast (>= 1.2.0, < 2.0) to support your Ruby & RubyGems was 1.4.1. Try installing it with `gem install rubocop-ast -v 1.4.1` and then running the current command again
	rubocop-ast requires Ruby version >= 2.5.0. The current ruby version is 2.4.10.364.
gem update --system
gem install rubocop -v 1.6.1
Fetching rubocop-ast-1.4.1.gem
Successfully installed unicode-display_width-1.7.0
Successfully installed ruby-progressbar-1.11.0
Successfully installed rubocop-ast-1.4.1
Successfully installed rubocop-1.6.1
4 gems installed

@mmb mmb closed this as completed May 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants