Can I `bundle install` to path other than `vendor/bundle`?

bundler
ruby

#1

I am migrating a project that was previously built only on macOS to run on Ubuntu.

My config.yml previously contained this line:

            bundle check || bundle install --jobs=4 --retry=3 --path .bundle

This gave me a lot of errors on bundle install or unarchiving the cache:

tar: Users: Cannot mkdir: Permission denied
tar: Users/distiller/project/.bundle/ruby/2.3.0/cache/rb-readline-0.5.5.gem: Cannot open: No such file or directory

Then I found the sample configuration:
https://circleci.com/docs/2.0/language-ruby/#sample-configuration

      - run:
          name: Bundle Install
          command: bundle install --path vendor/bundle

Using vendor/bundle instead of .bundle to install the dependencies worked.

Unfortunately quite some parts of our tests go through all files in the project directory (run the tests, ensure no debug code etc). This means I would now have to exclude vendor/bundle or vendor for all these.

As I don’t really understand everything that is happening there (I am new to the project, and it has a few thousand tests), I would rather not do that.

Is there a way to bundle install to a directory outside of my project directory?

Thanks,
Jan


#2

I am currently discovering/wondering if the problem was that I used the same cache as for the Mac branch, so I am rechecking my assumptions about .bundle not working as install path.


#3

Indeed, everything seems to work just fine with .bundle on Ubuntu as on Mac.

I only had to change the cache key, as the process couldn’t extract the cache from Mac on Ubuntu.
Now with a new cache key, everything works as expected.


#4

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.