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

T

Tim Hunter

Zhao said:
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.
 
R

Rob Biedenharn

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
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top