Skip to content
On this page

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

class · Ruby 4.1

Gem::ConfigFile

< Object include Gem::UserInteraction 32 instance methods 6 class methods

Gem::ConfigFile RubyGems options and gem command options from gemrc.

gemrc is a YAML file that uses strings to match gem command arguments and symbols to match RubyGems options.

Gem command arguments use a String key that matches the command name and allow you to specify default arguments:

install: --no-rdoc --no-ri
update: --no-rdoc --no-ri

You can use gem: to set default arguments for all commands.

RubyGems options use symbol keys. Valid options are:

:backtrace

See backtrace

:bulk_threshold

See bulk_threshold

:cooldown

See cooldown

:verbose

See verbose

:update_sources

See update_sources

:concurrent_downloads

See concurrent_downloads

:cert_expiration_length_days

See cert_expiration_length_days

:install_extension_in_lib

See install_extension_in_lib

:ipv4_fallback_enabled

See ipv4_fallback_enabled

:global_gem_cache

See global_gem_cache

:use_psych

See use_psych

:credential_store

See credential_store

:gemhome

See home

:gempath

See path

:sources

Sets Gem::sources

:disable_default_gem_server

See disable_default_gem_server

:ssl_verify_mode

See ssl_verify_mode

:ssl_ca_cert

See ssl_ca_cert

:ssl_client_cert

See ssl_client_cert

gemrc files may exist in various locations and are read and merged in the following order:

  • system wide (/etc/gemrc)

  • per user (~/.gemrc)

  • per environment (gemrc files listed in the GEMRC environment variable)

Class methods 6

Instance methods 32

Constants

The account name under which the default RubyGems.org API key is stored in the credential store, mirroring the :rubygems_api_key symbol used by the plain text credentials file.

No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available

For Ruby packagers to set configuration defaults. Set in rubygems/defaults/operating_system.rb

For Ruby implementers to set configuration defaults. Set in rubygems/defaults/#{RUBY_ENGINE}.rb

No documentation available
Attributes
Read

List of arguments supplied to the config file object.

Write

True if we print backtraces on errors.

Read & Write

Bulk threshold value. If the number of missing gems are above this threshold value, then a bulk download technique is used. (deprecated)

Expiration length to sign a certificate

Read & Write

Number of gem downloads that should be performed concurrently.

Read & Write

Number of days a newly published gem version must wait before it is considered for installation or update (the cooldown period). 0 disables the cooldown, unless Bundler is configured with a longer one: this setting and Bundler’s own cooldown setting are both read, and the longer of the two applies, so a cooldown configured for only one of the two tools still covers both. --cooldown overrides both.

A value that cannot be read as a non-negative integer warns and takes no part in that resolution, so a typo in the gemrc file does not make every command fail.

Read & Write

Experimental ==

Store and read push/authentication credentials in a credential store instead of the plain text credentials file. true selects the operating system’s native store (macOS Keychain, Linux Secret Service, Windows Credential Manager) when one is available on this platform. A string selects a named backend registered by a third-party gem, such as +“1password”+. false (the default) keeps using the credentials file.

True if we want to force specification of gem server when pushing a gem

Read & Write

Use a global cache for .gem files shared across all Ruby installations. When enabled, gems fetched from a remote source are cached to ~/.cache/gem/gems (or XDG_CACHE_HOME/gem/gems). Gems installed from a local path are not, since a cached copy is later reused without being verified again. gem fetch still writes to the working directory, and an unwritable cache directory falls back to the cache of the installation.

Read
No documentation available
Read & Write

Where to install gems (deprecated)

Install extensions into lib as well as into the extension directory.

Read & Write

Experimental ==

Fallback to IPv4 when IPv6 is not reachable or slow (default: false)

Read & Write

Where to look for gems (deprecated)

Read & Write

sources to look for gems

Read & Write

Path name of directory or file of openssl CA certificate, used for remote https connection

Path name of directory or file of openssl client certificate, used for remote https connection with client authentication

openssl verify mode value, used for remote https connection

Read & Write

True if we want to update the SourceInfoCache every time, false otherwise

Read & Write

Use Psych (C extension YAML parser) instead of the pure Ruby YAMLSerializer.

Read & Write

Verbose level of output:

  • false – No output

  • true – Normal output

  • :loud – Extra output