andy4thehuynh
andy4thehuynh

Reputation: 2172

How do I know if I have a gem on my local machine?

I have the Rails gem and the data_mapper gem installed on my local machine (macbook). When I am in my terminal, I can type which rails and it give me a directory like /Users/andyhuynh/.rvm/gems/ruby-1.9.3-p392/bin/rails.

However, if I type which data_mapper, I get data_mapper not found. How am I able to figure out what gems I have installed on my local machine? Many thanks for any help!

Upvotes: 0

Views: 133

Answers (3)

bonzofenix
bonzofenix

Reputation: 645

In case you are using RVM or any other Ruby version manager, you might have it install in other Ruby version.

rvm list

will let you know which version you have installed and which one you are using. Check on other versions with:

rvm use 'ruby_version'

and then

gem list gemname

Upvotes: 0

dredozubov
dredozubov

Reputation: 725

You are searching for executable files with which. You can list all gems with gems list or bundle list if you are using bundler.

You can search for specific gem with gem list | grep gemname or bundle show gemname.

Upvotes: 1

sandymatt
sandymatt

Reputation: 5612

How do I know if I have a gem on my local machine?

Type gem list.

Upvotes: 2

Related Questions