Question

I am studying The Well Grounded Rubyist, in which I have an exercise to look at the installation directories and configuration of Ruby using the following options:

    irb --simple-prompt -rrbconfig 
    >> Config::CONFIG["binddir"] 
  • RbConfig is the library that has "a lot of precompiled information about the ruby installation"
  • Config::CONFIG is a constant that identifies the hash table where Ruby has it's configuration settings. My trouble is that I get the error message "Use RbConfig instead of the obsolete and deprecated Config".

It seems to me that irb does not recognize Config::CONFIG as a constant.

I am using Ruby 1.9.3 on Windows 8.

How do I check the configuration data structure of Ruby?

Était-ce utile?

La solution

Config is deprecated:

 $ irb
 001> Config
 (irb):1: Use RbConfig instead of obsolete and deprecated Config.
 => RbConfig

You should do

 002> RbConfig::CONFIG
 => { ... humongous hash ... }
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top