Linux - troubleshooting gem install
suggest changegem install nokogiri, from the Gems example, can fail when the account cannot write the install directory. There is more than one way to fix that.
Solution a:
sudo installs the gem for every user. Use it only for a gem that every account should have. Most accounts should not use sudo for gems.
$> sudo gem install nokogiri
Solution b:
--user-install installs gems into your user gem directory (usually ~/.gem):
$> gem install nokogiri --user-install
Solution c:
Set GEM_HOME and GEM_PATH so gem install writes gems to a directory you choose. A common choice:
- Open
.bashrcin nano or another editor.
$> nano ~/.bashrc
- Then at the end of this file write
export GEM_HOME=$HOME/.gem
export GEM_PATH=$HOME/.gem
- Open a new terminal, or run
. ~/.bashrc, to reload the configuration.gem install nokogirithen installs into the directory you set.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents