Specify gem installation directory

To install foo gem to a specified folder, just use --install-dir option, i.e.

$ gem install --install-dir /path/to/gems/folder foo

It helps when:

  • one cannot use bundle install – e.g. if one wants to install bundle gem itself, or wants to install a gem (which is not listed in Gemfile) into the bundle folder
  • sudo gem install command fails due to lack of write-permissions for a default installation path

Hope that helps.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)