Giter Site home page Giter Site logo

Comments (6)

thestelz avatar thestelz commented on August 18, 2024 1

@daviscale We haven't made it to our upgrade cycle just yet (had other issues bump this down in priority). I know that my colleague is working in ruby 3.0.1 and doesn't have this issue.

from action-rubocop.

mgrachev avatar mgrachev commented on August 18, 2024

I think this problem is in Ruby 2.5. Please use v2.6 or higher:

$ ruby25 -r pathname -e 'p Pathname.new("/usr/bin/cc").relative_path_from("/usr/bin")' 
Traceback (most recent call last):
        1: from -e:1:in `<main>'
/usr/local/lib/ruby/2.5/pathname.rb:508:in `relative_path_from': undefined method `cleanpath' for "/usr/bin":String (NoMethodError)
$ ruby26 -r pathname -e 'p Pathname.new("/usr/bin/cc").relative_path_from("/usr/bin")' 
#<Pathname:cc>

Taken from here.

from action-rubocop.

thestelz avatar thestelz commented on August 18, 2024

@mgrachev Thanks for the update! I didn't know that was an issue. We do have it on our list to get our app updated to at least ruby 2.7 (shooting for 3.1) this year.

from action-rubocop.

daviscale avatar daviscale commented on August 18, 2024

@thestelz were you able to confirm that upgrading to ruby 2.7 fixed this issue?

from action-rubocop.

thestelz avatar thestelz commented on August 18, 2024

@daviscale I was able to update my application to ruby 2.7.5 (rails 5.2.8) and that fixed the cleanpath issue, but now I'm getting the following error:

ERROR:  Error installing rubocop:
  	The last version of rubocop-ast (< 2.0, >= 1.17.0) to support your Ruby & RubyGems was 1.17.0. Try installing it with `gem install rubocop-ast -v 1.17.0` and then running the current command again
  	rubocop-ast requires Ruby version >= 2.6.0. The current ruby version is 2.5.0.

My gemfile for rubocop:

gem 'rubocop', '~> 1.29.1', require: false

Gemfile.lock:

rubocop (1.29.1)
  parallel (~> 1.10)
  parser (>= 3.1.0.0)
  rainbow (>= 2.2.2, < 4.0)
  regexp_parser (>= 1.8, < 3.0)
  rexml (>= 3.2.5, < 4.0)
  rubocop-ast (>= 1.17.0, < 2.0)
  ruby-progressbar (~> 1.7)
  unicode-display_width (>= 1.4.0, < 3.0)

Is this an issue with rubocop itself or is there something else going on that I can't think of?

from action-rubocop.

thestelz avatar thestelz commented on August 18, 2024

@daviscale Nvm. I'm dumb and forgot to update the reviewdog.yml file to use ruby 2.7.5

-ruby-version: 2.5.3
+ruby-version: 2.7.5

Everything is now working as expected. Thank you for your help!

from action-rubocop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.