Coder Social home page Coder Social logo

Comments (10)

alloy avatar alloy commented on June 22, 2024

Sigh. This happens because the RuboCop constant is used when reading the Rakefile, so this line should probably also rescue missing constants:

rescue LoadError, NameError => e

from rainforest.

ashfurrow avatar ashfurrow commented on June 22, 2024

https://www.youtube.com/watch?v=-rPEguSf35c

from rainforest.

alloy avatar alloy commented on June 22, 2024

It’s interesting that this require statement does not make the RuboCop constant available.

from rainforest.

segiddins avatar segiddins commented on June 22, 2024

It does, I think...

from rainforest.

fabiopelosin avatar fabiopelosin commented on June 22, 2024

The issue is that the Rubocop constant was renamed to RuboCop, in a past version of the gem.

Rainforest doesn't have a Gemfile and this leads to Ruby using the gems that it has installed instead of the ones of the bundle of each single repo.

A solution could be to use bundle exec in the https://github.com/CocoaPods/Rainforest/blob/master/Rakefile#L89 line:

      Dir.chdir(dir) do
        subtitle "Bootstrapping #{dir}"
        if has_rake_task?('bootstrap')
          sh "bundle exec rake --no-search bootstrap"
        end
      end

However this solution, at least as proposed, is not working:

/Users/fabio/.rbenv/versions/2.1.2/bin/rake:23:in `load': cannot load such file -- /Users/fabio/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/specifications/default/bin/rake (LoadError)
    from /Users/fabio/.rbenv/versions/2.1.2/bin/rake:23:in `<main>'
rake aborted!

from rainforest.

alloy avatar alloy commented on June 22, 2024

We should’t use bundle exec for bootstrapping in the first place, that’s what the whole bootstrap vs other gems+rescue is about: so that you can run the bootstrap task, even if the bundle hasn’t been installed.

from rainforest.

alloy avatar alloy commented on June 22, 2024

Btw, this has been fixed on the Xcodeproj rep, not sure why it’s still open here.

from rainforest.

fabiopelosin avatar fabiopelosin commented on June 22, 2024

Good call, I remember that I explored a couple of approaches but I wasn't satisfied with any.

Anyway the issue might not be completely solved. Other exceptions than name errors which might arise from the versions of the gems of the bundle not being the same as the ones of the ruby installation are not catched. However I propose to keep this closed for lack of better solution (also our coverage in the real world should be pretty high with this one).

from rainforest.

alloy avatar alloy commented on June 22, 2024

The only proper solution is to not rely on RuboCop to define the rake task, but just define a rake task ourselves and lazily load RuboCop from there once needed.

The RuboCop task is most probably an over-engineered feature anyways, I rarely come across tasks that couldn’t simply be defined manually.

from rainforest.

fabiopelosin avatar fabiopelosin commented on June 22, 2024

👍

from rainforest.

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.