Download libraries to your project folder

This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the workflows category.

Last Updated: 2024-04-18

Say you are working with a Rails application. Then it will have many gems (libraries). It is convenient to download these gems into the folder where you are working. This means you can easily read or modify the code from the libraries and insert debuggers if necessary.

Tell bundler (gem installer) to install locally rather than in a faraway folder

$ bundle install --path vendor/bundle

Then make the folder easier to get to

# ./gems now works
$ ln -s vendor/bundle/ruby/2.6.0/gems gems

Having easy access to this library code is also a great way to learn more about good coding practices