Confirm where Ruby Gems are Installed

gem environment in macOS gem environment in macOS

I’m super close to this website switchover to Jekyll, am on track to migrating from WordPress setup for Unix Tutorial by May 1st 2020.

Putting some final touches in, I was investigating how RSS (Atom, actually) feeds work in Jekyll, and wanted to have a look at one of the jekyll plugins: jekyll-feed.

Since all the plugins in Jekyll are actually Ruby gems installed and managed by the bundler package, it was relatively easy to know where to look.

I couldn’t find any jekyll-feed files in my Jekyll directory for the website, and so I had to learn a bit more about working with gems.

Show RubyGems Environment There’s a really cool command called “gem environment” that shows 99% of all the Ruby gems related information on your system:

greys@mcfly:~ $ gem environment
 RubyGems Environment:
 RUBYGEMS VERSION: 3.0.6
 RUBY VERSION: 2.6.5 (2019-10-01 patchlevel 114) [x86_64-darwin18]
 INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/2.6.0
 USER INSTALLATION DIRECTORY: /Users/greys/.gem/ruby/2.6.0
 RUBY EXECUTABLE: /usr/local/opt/ruby/bin/ruby
 GIT EXECUTABLE: /usr/local/bin/git
 EXECUTABLE DIRECTORY: /usr/local/lib/ruby/gems/2.6.0/bin
 SPEC CACHE DIRECTORY: /Users/greys/.gem/specs
 SYSTEM CONFIGURATION DIRECTORY: /usr/local/Cellar/ruby/2.6.5/etc
 RUBYGEMS PLATFORMS: ruby
 x86_64-darwin-18
 GEM PATHS: /usr/local/lib/ruby/gems/2.6.0
 /Users/greys/.gem/ruby/2.6.0
 /usr/local/Cellar/ruby/2.6.5/lib/ruby/gems/2.6.0
 GEM CONFIGURATION: :update_sources => true
 :verbose => true
 :backtrace => false
 :bulk_threshold => 1000
 REMOTE SOURCES: https://rubygems.org/
 SHELL PATH: /usr/local/opt/[email protected]/bin
 /Library/Frameworks/Python.framework/Versions/3.6/bin
 /Users/greys/bin
 /usr/local/opt/ruby/bin
 /usr/local/bin
 /usr/bin
 /bin
 /usr/sbin
 /sbin 

Turns out, the jekyll-feed plugin files were under one of the GEM PATHS locations /usr/local/lib/ruby/gems/2.6.0 in my case.

See Also




Keep Learning

Follow me on Facebook, Twitter or Telegram:
Recommended
I learn with Educative: Educative
IT Consultancy
I'm a principal consultant with Tech Stack Solutions. I help with cloud architectrure, AWS deployments and automated management of Unix/Linux infrastructure. Get in touch!

Recent Tweets