How to see the all keys of "RbConfig::CONFIG"?

How to see the all keys of “RbConfig::CONFIG” ?


[email protected]:~$ irb --simple-prompt -rrbconfig
>> Config::CONFIG["bindir"]
(irb):1: Use RbConfig instead of obsolete and deprecated Config.
=> "/usr/bin"
>> RbConfig::CONFIG["bindir"]
=> "/usr/bin"

##Try the below,which in turn gives you the all keys.##

>> RbConfig::CONFIG.keys
=> ["DESTDIR", "MAJOR", "MINOR", "TEENY", "PATCHLEVEL", "INSTALL",
"EXEEXT", "prefix", "ruby_install_name", "RUBY_INSTALL_NAME",
"RUBY_SO_NAME", "exec", "ruby_pc", "PACKAGE", "BUILTIN_TRANSSRCS",
"USE_RUBYGEMS", "MANTYPE", "NROFF", "vendorhdrdir", "sitehdrdir",
"rubyhdrdir", "UNIVERSAL_INTS", "UNIVERSAL_ARCHNAMES", "configure_args",
"vendordir", "sitedir", "ruby_version", "sitearch", "arch",
"RI_BASE_NAME", "ridir", "rubylibprefix", "MAKEFILES", "THREAD_MODEL",
"SYMBOL_PREFIX", "EXPORT_PREFIX", "COMMON_HEADERS", "COMMON_MACROS",
"COMMON_LIBS", "MAINLIBS", "ENABLE_SHARED", "DLDLIBS", "SOLIBS",
"LIBRUBYARG_SHARED", "LIBRUBYARG_STATIC", "LIBRUBYARG", "LIBRUBY",
"LIBRUBY_ALIASES", "LIBRUBY_SO", "LIBRUBY_A", "RUBYW_INSTALL_NAME",
"rubyw_install_name", "LIBRUBY_DLDFLAGS", "LIBRUBY_LDSHARED",
"warnflags", "debugflags", "optflags", "cxxflags", "cflags", "cppflags",
"NULLCMD", "INSTALLDOC", "CAPITARGET", "RDOCTARGET", "EXECUTABLE_EXTS",
"ARCHFILE", "LIBRUBY_RELATIVE", "EXTOUT", "PREP", "TEST_RUNNABLE",
"setup", "EXTSTATIC", "STRIP", "TRY_LINK", "LIBPATHENV", "RPATHFLAG",
"LIBPATHFLAG", "LINK_SO", "LIBEXT", "DLEXT2", "DLEXT", "LDSHAREDXX",
"LDSHARED", "CCDLFLAGS", "STATIC", "ARCH_FLAG", "DLDFLAGS", "ALLOCA",
"WERRORFLAG", "CHDIR", "RMALL", "RMDIRS", "RMDIR", "CP", "RM",
"PKG_CONFIG", "DOXYGEN", "DOT", "MAKEDIRS", "MKDIR_P", "INSTALL_DATA",
"INSTALL_SCRIPT", "INSTALL_PROGRAM", "SET_MAKE", "LN_S", "NM",
"DLLWRAP", "WINDRES", "OBJCOPY", "OBJDUMP", "ASFLAGS", "AS", "AR",
"RANLIB", "try_header", "COUTFLAG", "OUTFLAG", "CPPOUTFILE", "GNU_LD",
"GCC", "EGREP", "GREP", "CPP", "CXXFLAGS", "CXX", "OBJEXT", "CPPFLAGS",
"LDFLAGS", "CFLAGS", "CC", "target_os", "target_vendor", "target_cpu",
"target", "host_os", "host_vendor", "host_cpu", "host",
"RUBYW_BASE_NAME", "RUBY_BASE_NAME", "build_os", "build_vendor",
"build_cpu", "build", "RUBY_RELEASE_DATE", "RUBY_PROGRAM_VERSION",
"BASERUBY", "target_alias", "host_alias", "build_alias", "LIBS",
"ECHO_T", "ECHO_N", "ECHO_C", "DEFS", "mandir", "localedir", "libdir",
"psdir", "pdfdir", "dvidir", "htmldir", "infodir", "docdir",
"oldincludedir", "includedir", "localstatedir", "sharedstatedir",
"sysconfdir", "datadir", "datarootdir", "libexecdir", "sbindir",
"bindir", "program_transform_name", "exec_prefix", "PACKAGE_URL",
"PACKAGE_BUGREPORT", "PACKAGE_STRING", "PACKAGE_VERSION",
"PACKAGE_TARNAME", "PACKAGE_NAME", "PATH_SEPARATOR", "SHELL",
"rubylibdir", "archdir", "sitelibdir", "sitearchdir", "vendorlibdir",
"vendorarchdir", "topdir"]

See the value of the key any of your needed.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> RbConfig::CONFIG["host_os"]
=> "linux-gnu"
>>

puts RbConfig::CONFIG

Joel P. wrote in post #1096373:

puts RbConfig::CONFIG

Humm! that’s also would work!

This has been helpful to me:

require 'rbconfig'
require 'yaml'

y RbConfig::CONFIG

Am 11.02.2013 21:29, schrieb Love U Ruby:

How to see the all keys of “RbConfig::CONFIG” ?

[…]

RbConfig::CONFIG.keys
=> [“DESTDIR”, “MAJOR”, “MINOR”, “TEENY”, “PATCHLEVEL”, “INSTALL”,
[…]

and what is your question???

unknown wrote in post #1096424:

Am 11.02.2013 21:29, schrieb Love U Ruby:

How to see the all keys of “RbConfig::CONFIG” ?

[…]

RbConfig::CONFIG.keys
=> [“DESTDIR”, “MAJOR”, “MINOR”, “TEENY”, “PATCHLEVEL”, “INSTALL”,
[…]

and what is your question???

I just shared this and would like to see also, in what else way we can
do that?

Thanks