Home > Blockchain >  Why does changing Bundlers installation directory cause Sorbet to fall over?
Why does changing Bundlers installation directory cause Sorbet to fall over?

Time:03-19

For reasons to do with my CI setup I've needed to change the location where I install my Ruby gems from the default location to: bundle config set path 'vendor/bundle'

However, as soon as I do so, Sorbet loses it's cool and throws out over 6,000 errors. Why would Sorbet be so sensitively dependent on where the gem is installed? (I clear all of the gems before switching location so it's very unlikely to be due to a clash of gem versions).

Summary

When gems are installed to:

/Users/my-home-directory/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems

bundle exec srb tc works fine. But when gems are installed to:

/Users/my-home-directory/project-name/vendor/bundle/ruby/2.7.0/gems/

then running bundle exec srb tc generates thousands of errors.

CodePudding user response:

By default, Sorbet attempts to typecheck the entire directory under project-name. Try adding the following line to sorbet/config:

--ignore=/vendor/bundle

(This should be automatically included in newer installs of sorbet that incorporate https://github.com/sorbet/sorbet/pull/3897 )

  • Related