ruby,

Forcing bundler to install gems in users home directory

May 23, 2023 · 1 min read · Post a comment

By default, bundler install gems under /usr/local/bundle which is the default value for $GEM_HOME and $BUNDLE_APP_CONFIG when using Ruby’s official Docker images. Here’s what you can do.

Prerequisites

  • Ruby

Solution

Update the bundle config to set a local path. For instance try running something like this:

bundle config set --local path '/home/<some_user>/.gems'
bundle install

Conclusion

In case you face any issues, feel free to leave a comment below and if you find this tutorial useful, follow our official channel on Telegram.