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:
 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
 GEM PATHS: /usr/local/lib/ruby/gems/2.6.0
 GEM CONFIGURATION: :update_sources => true
 :verbose => true
 :backtrace => false
 :bulk_threshold => 1000
 SHELL PATH: /usr/local/opt/[email protected]/bin

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:
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