I have used sudo gem install to install a few gems. My question is how do I know where the executable was installed, so I can add it to the path in .bash_profile?


Ruby "Gems" are not generally applications, most often they are libraries. From the Ruby Gems website

1.1 Really Quick Start Question: I’ve installed RubyGems and I want to install Rails (for example). How do I do that?


gem install rails

1.2 What is a Gem?

A gem is a packaged Ruby application or library. It has a name (e.g. rake) and a version (e.g. 0.4.16).

(emphasis mine)

Also, see this information on how to inspect a gem:

2.5 Looking at an installed gem When you run

gem specification  progressbar
# shortcut: gem spec progressbar

you will see all the details of the ’’progressbar’’ gem.

You should consult the documentation which came with the gem, or, post more details so we can assist you more.


Use the gem env command to display where Gems stores everything.

Greg:~ greg$ gem env
RubyGems Environment:
  - RUBY VERSION: 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
  - INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8
  - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
    - ruby
    - universal-darwin-10
     - /Library/Ruby/Gems/1.8
     - /Users/greg/.gem/ruby/1.8
     - /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - http://gems.rubyforge.org/

However, to avoid having to use sudo to install gems into the System version of Ruby, I use RVM, which sandboxes all my gems plus any additional versions of Ruby I want to install. I've been using it for a while and love it.

  • This was actually the root cause of my problem, I was using RVM. But had not set the appropriate version of ruby in my session. Still learning... – mxmissile Dec 13 '10 at 16:28
  • Use rvm use 1.9.2 --default to set a particular version of Ruby as your default. Of course you'll want to substitute the version of Ruby you favor if it's different than 1.9.2. – Greg Dec 13 '10 at 16:31

Also if you type: gem list

then you will get a list of all the gems that you have installed. At least that way you can check to see if it installed properly and which ones you currently have installed.

The path to my gems on my Windows PC is:


Probably the same location/file hierarchy on the Mac as well. (except for that whole C:/ part ;-)


I took the following quote from the page talking about installing Sproutcore. It might help you in figuring out this path issue. Let me know! (I am a n00b when it comes to this stuff. I just starting learning it yesterday! But I found lots of helpful information!)


if you faced a problem during the last part then this probably because the PATH of the gem isn't the default one. You can call the command as

/var/lib/gems/1.8/bin/sc-init HelloWorld cd hello_world sc-server

Or you may reconfigure the path by running the following command

      export PATH

Then rerun sc-init command.

Now visit http://localhost:4020/hello_world to see your handiwork.


I believe that al that is in /usr/bin and similar.

You can always try whereis xxxxx and locate xxxx (after both db’s have been rebuilt via the daily/weekly scripts).

Most of those things go somewhere inside /usr sometimes /usr/local.

  • 1
    Maybe I'm missing something but type xxxx usually works better for me. – Robert S Ciaccio Dec 10 '10 at 17:57
  • Huh. Never knew about type before. – Jason Salaz Dec 10 '10 at 18:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .