Forum: Ruby How can I find the source of ruby package installed by gem

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
7fbd0e99b27064b14793f028022974e5?d=identicon&s=25 Zhao Yi (youhaodeyi)
on 2009-01-06 02:57
I installed a ruby application by gem. Where can I find its source code?
3afd3e5e05dc9310c89aa5762cc8dd1d?d=identicon&s=25 Tim Hunter (Guest)
on 2009-01-06 03:17
(Received via mailing list)
Zhao Yi wrote:
> I installed a ruby application by gem. Where can I find its source code?

gem unpack

unpacks a gem to the current directory.

gem env

shows where gems are installed.
7fbd0e99b27064b14793f028022974e5?d=identicon&s=25 Zhao Yi (youhaodeyi)
on 2009-01-06 03:27
Tim Hunter wrote:
> Zhao Yi wrote:
>> I installed a ruby application by gem. Where can I find its source code?
>
> gem unpack
>
> unpacks a gem to the current directory.
>
> gem env
>
> shows where gems are installed.

OK, it works. thanks.
Ef3aa7f7e577ea8cd620462724ddf73b?d=identicon&s=25 Rob Biedenharn (Guest)
on 2009-01-06 04:13
(Received via mailing list)
On Jan 5, 2009, at 9:27 PM, Zhao Yi wrote:

>>
>> shows where gems are installed.
>
> OK, it works. thanks.
> --


There's also gem list -d gemname

$ gem list -d rails

*** LOCAL GEMS ***

rails (2.1.2, 2.1.0, 2.0.2, 1.2.6, 1.2.5, 1.2.3)
     Author: David Heinemeier Hansson
     Rubyforge: http://rubyforge.org/projects/rails
     Homepage: http://www.rubyonrails.org
     Installed at (2.1.2): /Library/Ruby/Gems/1.8
                  (2.1.0): /Library/Ruby/Gems/1.8
                  (2.0.2): /Library/Ruby/Gems/1.8
                  (1.2.6): /System/Library/Frameworks/Ruby.framework/
Versions/1.8/usr/lib/ruby/gems/1.8
                  (1.2.5): /Library/Ruby/Gems/1.8
                  (1.2.3): /System/Library/Frameworks/Ruby.framework/
Versions/1.8/usr/lib/ruby/gems/1.8

     Web-application framework with template engine, control-flow layer,
     and ORM.

So if you're looking to know where a particular version of a gem is
installed, it can be better than gem env:

$ gem env
RubyGems Environment:
   - RUBYGEMS VERSION: 1.3.1
   - RUBY VERSION: 1.8.6 (2008-03-03 patchlevel 114) [universal-
darwin9.0]
   - INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8
   - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/
Versions/1.8/usr/bin/ruby
   - EXECUTABLE DIRECTORY: /usr/bin
   - RUBYGEMS PLATFORMS:
     - ruby
     - universal-darwin-9
   - GEM PATHS:
      - /Library/Ruby/Gems/1.8
      - /Users/rab/.gem/ruby/1.8
      - /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/gems/1.8
   - GEM CONFIGURATION:
      - :update_sources => true
      - :verbose => true
      - :benchmark => false
      - :backtrace => false
      - :bulk_threshold => 1000
   - REMOTE SOURCES:
      - http://gems.rubyforge.org/

Hopefully, this gives you much more information that you needed ;-)

-Rob

Rob Biedenharn    http://agileconsultingllc.com
Rob@AgileConsultingLLC.com
This topic is locked and can not be replied to.