How to fix slow gem installs
19 Apr 2015If youâve ever run gem install, you know how long it can take to complete. Trust me, youâre not alone: plenty of examples showcase similar frustrations in dealing with slow gem install.
Most larger Ruby projects comes with extensive documentation (awesome! đ), unfortunately the process of turning RDoc into HTML and ri can be quite time-consuming - especially on larger projects or slower machines.
Fortunately, itâs possible to turn off ri and rdoc processing on gem install by executing the command with flags --no-ri and --no-rdoc:
$ gem install rails --no-rdoc --no-riNow keep in mind that RDoc and ri is actually pretty cool and if you use them often, instead of online documentation, then you might want to skip this.
If you want this as your default behavior add this to your ~/.gemrc file:
gem: --no-ri --no-rdocAnother option is to create a Shell alias for gem install that in addition also prefixes with sudo to avoid those pesky âYou donât have write permissions âŚâ:
# Alias
$ alias gemi=âsudo gem install âno-ri âno-rdocâ
# Usage
$ gemi rails