By default, binaries installed by gem will be placed into: /usr/local/lib/ruby/gems/3.1.
The main place where libraries are hosted is RubyGems.org, a public repository of gems that can be searched and installed onto your machine. You may browse and search for gems using the RubyGems website, or use the gem command. Using gem search -r , you can search RubyGems' repository.
RubyGems is a package utility for Ruby, which installs Ruby software packages and keeps them up-to-date.
Use `gem install -v` You may already be familiar with gem install , but if you add the -v flag, you can specify the version of the gem to install. Using -v you can specify an exact version or use version comparators.
I have a performance problem with my ruby on my machine, which I think I have isolated to loading libraries (when #require is called), so I'm trying to work out whether ruby is searching too many folders for libraries.
When I run
$ gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.0
- 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/matt/.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
- :sources => ["http://gems.rubyforge.org", "http://gems.github.com/"]
- REMOTE SOURCES:
- http://gems.rubyforge.org
- http://gems.github.com/
There's nothing much on /Users/matt/.gem, but there's tons in both /Library/Ruby and in /System/Library/Frameworks/Ruby.framework.
What gives? Is this normal?
Thanks in advance, folks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With