gem
gem search [pkgname]search particular packagegem install [pkgname]install particular packagegem listshow insatalled packages-
gem uninstall pkgnameuninstall package -
compiler
rubysudo apt install rubysudo apt install ruby-dev
- packages are called
gems gemsare installed inGEM_PATHso set these variables in your shellexport GEM_HOME=$HOME/.gemandexport GEM_PATH=$HOME/.gem- how to use gems in your project
- mentioned in the
Gemfile
- mentioned in the
How to install gem
gem install buldler- installs thebundlergem for current user- location
$GEM_HOME
- location
- if you do
sudo gem install bundlerthen it will install the gem for all users- location
/usr/share/rubygems-integration
- location
How to remove a gem
gem list- show list of installed gemsgem list --no-versions- show installed gems without there versionsgem uninstall gem-name- remove a gem if it is install only for current user
sudo gem uninstall gem-name- remove a gem
sudo gem uninstall -i /usr/share/rubygems-integration/all gem-name- forcefully remove a gem
- remove all installed gems:
for i in `gem list --no-versions`; do sudo gem uninstall -aIx $i; done
sudo gem update --systemupdate gems
bundler
- bundler is used to manage dependencies
bundle installinstall all the gems mentioned in gemfile