Until this time, there were no problems.
Now, after running the bundle update command, the gem isn't updated.
And this command:
bundle update rubocop
Says this:
```
Using rubocop 1.4.2
Using rubocop-performance 1.9.1
Using rubocop-rails 2.8.1
Bundler attempted to update rubocop but its version stayed the same
I just faced similar problem, maybe some other dependencies of your require regexp_parser < 2.0, but current rubocop require 2.0
https://github.com/rubocop-hq/rubocop/blob/master/rubocop.gemspec#L36
@ShockwaveNN I don't understand how this relates to the rest of the libraries? If rubocop needs something, it can install it. Moreover, this has nothing to do with the fact that my bundle doesn't see the new version at all.
Rubocop v1.5 require v2 of lib
Rubocop v1.4 require v1 of lib
Some other dependency require v1 of lib
In that case bundler will install rubocop v1.4
It's just how bundler works
@ShockwaveNN I thought that if the library depends on something, then it installs it. 馃
In this case, what do I need to do to install the new version in all my rails 6.x projects? Because none of my applications can update rubocop to version 1.5.0.
You should figure out which of your deps require older version of any lib, I cannot tell without complete Gemspec, and please note that all I said it's just my toughts, since not a lot of info
I thought that if the library depends on something, then it installs it.
Bundler will only install one version of each library. Different from e.g. yarn which installs as many versions as it sees.
Maybe you can check in your Gemfile.lock if there is another dependency that requires an older version of regexp_parser. (Just search the file for regexp_parser.)
I think @ShockwaveNN's guess may be correct.
For example, if your Rails application specifies Capybara (3.34.0 or lower) in the Gemfile (or Gemfile.lock), your application cannot upgrade to RuboCop 1.5 because you cannot upgrade to regexp_parser 2.0 because Capybara specifies regexp_parser ~> 1.5.
https://rubygems.org/gems/capybara/versions/3.34.0
When Capybara current master branch is released, it will be possible to update to regexp_parser 2 series.
https://github.com/teamcapybara/capybara/commit/2fd00e52b817b3baca4116f7dc0622bfd1645216
So, you'll have to wait until then or specify github in your Gemfile.
The same is true weather a gem that depends on regexp_parser is not Capybara.
Thanks everyone for the answers
BTW, I faced this issue while using watir
I made pr to fix it, hope dev team merge it
@koic is there the possibility to allow RuboCop to support both 1.x and 2.x versions of the regex parser. I'm having a large problem with multiple third party tools that are pinned to the 1.x release and probably won't ship anytime soon.
Anyway, the problem is solved in version 1.5.2
Yeah, this issue has been resolved by #9154 and #9162 included in RuboCop 1.5.2. Thank you for the feedback.
Most helpful comment
I think @ShockwaveNN's guess may be correct.
For example, if your Rails application specifies Capybara (3.34.0 or lower) in the Gemfile (or Gemfile.lock), your application cannot upgrade to RuboCop 1.5 because you cannot upgrade to regexp_parser 2.0 because Capybara specifies
regexp_parser ~> 1.5.https://rubygems.org/gems/capybara/versions/3.34.0
When Capybara current master branch is released, it will be possible to update to regexp_parser 2 series.
https://github.com/teamcapybara/capybara/commit/2fd00e52b817b3baca4116f7dc0622bfd1645216
So, you'll have to wait until then or specify
githubin your Gemfile.The same is true weather a gem that depends on regexp_parser is not Capybara.