New Ruby Startup

What happens when you invoke the Ruby interpreter, even before it executes your first line of code? Actually a lot! A few observations:

Initial Load Path

These are all locations you can Kernel#require from:

$ ruby --disable-all -e 'puts $LOAD_PATH.map{ |path| "- #{path}" }'

Initial Loaded Features

These are core libraries that will always get loaded by Ruby:

$ ruby --disable-all -e 'puts $LOADED_FEATURES.map{ |lib| "- #{lib} "}'

¹ Not actual files. They show up here for backward compatibility because they were moved from the standard library (thus had to be loaded first) to the core.

Initial Memory Consumption

Measured with Ruby 3.2.2 on an ubuntu machine:

$ ruby --disable-all -e'puts"%.2f MB".%`ps -o rss -p#$$$$`.strip.split.last.to_f/1024'

20.14 MB

Initial Ruby Objects

Via: ObjectSpace.each_object

$ ruby --disable-all -e 'puts \
" Ruby Object                   | Count\n" +
"-------------------------------|------\n" +
ObjectSpace.each_object.group_by(&:class).map{|k,v| [k, v.size]}.
sort_by(&:last).reverse.map{|k,v| "#{k.to_s.rjust(30)} | #{v}" }.
join("\n")'
Ruby Object Count
String 3327
Array 1087
Class 288
Encoding 103
Module 23
Hash 5
Float 4
IO 3
Object 3
Symbol 3
fatal 2
ARGF.class 1
SystemStackError 1
NoMemoryError 1
Ractor 1
RubyVM 1
Thread 1
Binding 1
IOError 1
ThreadGroup 1
Integer 1
Complex 1
File 1
Enumerator 1

Not listed in this table are "immediate" objects that are directly embedded in Ruby's underlying object system, for example, small integers.

Initial Numbers

Some interesting magic numbers:

$ ruby --disable-all -e 'puts ObjectSpace.each_object(Numeric).
map{ |n| "- #{n} (#{n.class})" }'

Initial Internal Objects

Via: ObjectSpace.count_objects

$ ruby --disable-all -e 'puts \
" Object    | Count\n" +
"-----------|------\n" +
ObjectSpace.count_objects.to_a.sort_by(&:last).
reverse.map{|k,v| "#{k.to_s.rjust(10)} | #{v}" }.
join("\n")'
Object Count
TOTAL 11460
T_IMEMO 3514
T_STRING 3328
FREE 2696
T_ARRAY 1113
T_CLASS 548
T_DATA 181
T_ICLASS 27
T_MODULE 23
T_HASH 10
T_OBJECT 7
T_FILE 4
T_FLOAT 4
T_SYMBOL 3
T_COMPLEX 1
T_BIGNUM 1

Initial Symbols

Via: Symbol.all_symbols

Related: Grammar rules for symbols

$ puts Symbol.all_symbols.sort.
map{ |s| s.inspect.sub("`", "\\`").gsub(/'/,"\\'") }.join(" ")

All symbols:

:"" :! :!= :!~ :"\"" :"#" :"$" :$! :$" :$$ :$& :$ :$* :$+ :$, :$-0 :$-F :$-I :$-W :$-a :$-d :$-i :$-l :$-p :$-v :$-w :$. :$/ :$0 :$: :$; :$< :$= :$> :$? :$@ :$DEBUG :$FILENAME :$LOADED_FEATURES :$LOAD_PATH :$PROGRAM_NAME :$VERBOSE :$\ :$_ :$:$ :$stderr :$stdin :$stdout :$~ :% :& :"&&" :"&." :""" :"(" :")" :* :** :+ :+@ :"," :- :-@ :"." :".." :"..." :/ :":" :"::" :";" :< :<< :<= :<=> :"<CFUNC>" :"<IFUNC>" :"=" :== :=== :=~ :> :>= :>> :"?" :"@" :@CALL_DATA :@IC :@IVC :@RB_BUILTIN :@VALUE :@attr_index_t :@compile_branch :@compile_status :@denominator :@gem_prelude_index :@image :@inlined_call_context :@iseq_inline_constant_cache :@iseq_inline_constant_cache_entry :@iseq_inline_iv_cache_entry :@iseq_inline_storage_entry :@mjit_options :@numerator :@path :@ractor :@rb_builtin_function :@rb_call_data :@rb_callable_method_entry_struct :@rb_callcache :@rb_callinfo :@rb_control_frame_t :@rb_cref_t :@rb_execution_context_struct :@rb_execution_context_t :@rb_iseq_constant_body :@rb_iseq_location_t :@rb_iseq_struct :@rb_iseq_t :@rb_method_definition_struct :@rb_method_iseq_t :@rb_method_type_t :@rb_mjit_compile_info :@rb_mjit_unit :@rb_serial_t :@rb_shape :@rb_shape_t :@real :@shape_id_t :AFTER_OUTPUT :ALT_SEPARATOR :ANSI_X3_4_1968 :APPEND :ARGF :ARGV :ASCII :ASCII_8BIT :AbstractSyntaxTree :AccessError :AllocationError :ArgumentError :ArithmeticSequence :Array :BASE_SLOT_SIZE :BIG5 :BIG5_HKSCS :BIG5_HKSCS_2008 :BIG5_UAO :BIG_ENDIAN :BINARY :Backtrace :Base :BasicObject :Big5 :Big5_HKSCS :Big5_HKSCS_2008 :Big5_UAO :Binding :BitField :Bool :Buffer :C :CALL_DATA :CESU_8 :CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID :CLOCK_BOOTTIME :CLOCK_BOOTTIME_ALARM :CLOCK_MONOTONIC :CLOCK_MONOTONIC_COARSE :CLOCK_MONOTONIC_RAW :CLOCK_PROCESS_CPUTIME_ID :CLOCK_REALTIME :CLOCK_REALTIME_ALARM :CLOCK_REALTIME_COARSE :CLOCK_TAI :CLOCK_THREAD_CPUTIME_ID :CP1250 :CP1251 :CP1252 :CP1253 :CP1254 :CP1255 :CP1256 :CP1257 :CP1258 :CP437 :CP50220 :CP50221 :CP51932 :CP65000 :CP65001 :CP720 :CP737 :CP775 :CP850 :CP852 :CP855 :CP857 :CP860 :CP861 :CP862 :CP863 :CP864 :CP865 :CP866 :CP869 :CP874 :CP878 :CP932 :CP936 :CP949 :CP950 :CP951 :CREAT :CRLF_NEWLINE_DECORATOR :CR_NEWLINE_DECORATOR :CSWINDOWS31J :CType :CUR :Chain :Class :ClosedError :ClosedQueueError :Comparable :CompatibilityError :Complex :ConditionVariable :Constants :Converter :ConverterNotFoundError :CsWindows31J :DATA :DEBUG :DEFAULT_PARAMS :DEFAULT_SIZE :DIG :DIRECT :DSYNC :Data :Default :DidYouMean :Dir :DomainError :E :E2BIG :EACCES :EADDRINUSE :EADDRNOTAVAIL :EADV :EAFNOSUPPORT :EAGAIN :EAGAINWaitReadable :EAGAINWaitWritable :EALREADY :EAUTH :EBADARCH :EBADE :EBADEXEC :EBADF :EBADFD :EBADMACHO :EBADMSG :EBADR :EBADRPC :EBADRQC :EBADSLT :EBCDIC_CP_US :EBFONT :EBUSY :ECANCELED :ECAPMODE :ECHILD :ECHRNG :ECOMM :ECONNABORTED :ECONNREFUSED :ECONNRESET :EDEADLK :EDEADLOCK :EDESTADDRREQ :EDEVERR :EDOM :EDOOFUS :EDOTDOT :EDQUOT :EEXIST :EFAULT :EFBIG :EFTYPE :EHOSTDOWN :EHOSTUNREACH :EHWPOISON :EIDRM :EILSEQ :EINPROGRESS :EINPROGRESSWaitReadable :EINPROGRESSWaitWritable :EINTR :EINVAL :EIO :EIPSEC :EISCONN :EISDIR :EISNAM :EKEYEXPIRED :EKEYREJECTED :EKEYREVOKED :EL2HLT :EL2NSYNC :EL3HLT :EL3RST :ELAST :ELIBACC :ELIBBAD :ELIBEXEC :ELIBMAX :ELIBSCN :ELNRNG :ELOOP :EMACS_MULE :EMEDIUMTYPE :EMFILE :EMLINK :EMSGSIZE :EMULTIHOP :ENAMETOOLONG :ENAVAIL :END :ENEEDAUTH :ENETDOWN :ENETRESET :ENETUNREACH :ENFILE :ENOANO :ENOATTR :ENOBUFS :ENOCSI :ENODATA :ENODEV :ENOENT :ENOEXEC :ENOKEY :ENOLCK :ENOLINK :ENOMEDIUM :ENOMEM :ENOMSG :ENONET :ENOPKG :ENOPOLICY :ENOPROTOOPT :ENOSPC :ENOSR :ENOSTR :ENOSYS :ENOTBLK :ENOTCAPABLE :ENOTCONN :ENOTDIR :ENOTEMPTY :ENOTNAM :ENOTRECOVERABLE :ENOTSOCK :ENOTSUP :ENOTTY :ENOTUNIQ :ENV :ENXIO :EOFError :EOPNOTSUPP :EOVERFLOW :EOWNERDEAD :EPERM :EPFNOSUPPORT :EPIPE :EPROCLIM :EPROCUNAVAIL :EPROGMISMATCH :EPROGUNAVAIL :EPROTO :EPROTONOSUPPORT :EPROTOTYPE :EPSILON :EPWROFF :EQFULL :ERANGE :EREMCHG :EREMOTE :EREMOTEIO :ERESTART :ERFKILL :EROFS :ERPCMISMATCH :ESHLIBVERS :ESHUTDOWN :ESOCKTNOSUPPORT :ESPIPE :ESRCH :ESRMNT :ESTALE :ESTRPIPE :ETIME :ETIMEDOUT :ETOOMANYREFS :ETXTBSY :EUCCN :EUCJP :EUCJP_MS :EUCKR :EUCLEAN :EUCTW :EUC_CN :EUC_JISX0213 :EUC_JIS_2004 :EUC_JP :EUC_JP_MS :EUC_KR :EUC_TW :EUNATCH :EUSERS :EWOULDBLOCK :EWOULDBLOCKWaitReadable :EWOULDBLOCKWaitWritable :EXCL :EXDEV :EXFULL :EXTENDED :EXTERNAL :Emacs_Mule :Encoding :EncodingError :Enumerable :Enumerator :Errno :Error :ErrorHighlight :EucCN :EucJP :EucJP_ms :EucKR :EucTW :Exception :F32 :F64 :FIXEDENCODING :FNM_CASEFOLD :FNM_DOTMATCH :FNM_EXTGLOB :FNM_NOESCAPE :FNM_PATHNAME :FNM_SHORTNAME :FNM_SYSCASE :FalseClass :Fiber :FiberError :File :FileTest :Float :FloatDomainError :Formatter :FrozenError :GB12345 :GB18030 :GB1988 :GB2312 :GBK :GC :GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID :GETTIMEOFDAY_BASED_CLOCK_REALTIME :GID :GMP_VERSION :Gem :Generator :HEAP_PAGE_BITMAP_SIZE :HEAP_PAGE_OBJ_LIMIT :HEAP_PAGE_SIZE :HOLE :HOST_ENDIAN :Hash :I :IBM037 :IBM437 :IBM720 :IBM737 :IBM775 :IBM850 :IBM852 :IBM855 :IBM857 :IBM860 :IBM861 :IBM862 :IBM863 :IBM864 :IBM865 :IBM866 :IBM869 :IC :ID :IGNORECASE :INFINITY :INSTRUCTION_NAMES :INTERNAL :INTERNAL_CONSTANTS :INVALID_MASK :INVALID_REPLACE :INVALID_SHAPE_ID :IO :IOError :ISO2022_JP :ISO2022_JP2 :ISO8859_1 :ISO8859_10 :ISO8859_11 :ISO8859_13 :ISO8859_14 :ISO8859_15 :ISO8859_16 :ISO8859_2 :ISO8859_3 :ISO8859_4 :ISO8859_5 :ISO8859_6 :ISO8859_7 :ISO8859_8 :ISO8859_9 :ISO_2022_JP :ISO_2022_JP_2 :ISO_2022_JP_KDDI :ISO_8859_1 :ISO_8859_10 :ISO_8859_11 :ISO_8859_13 :ISO_8859_14 :ISO_8859_15 :ISO_8859_16 :ISO_8859_2 :ISO_8859_3 :ISO_8859_4 :ISO_8859_5 :ISO_8859_6 :ISO_8859_7 :ISO_8859_8 :ISO_8859_9 :IVC :Immediate :IndexError :InstructionSequence :Integer :Interrupt :InvalidByteSequenceError :InvalidatedError :IsolationError :K :KOI8_R :KOI8_U :Kernel :KeyError :LF_NEWLINE_DECORATOR :LITTLE_ENDIAN :LOCKED :LOCK_EX :LOCK_NB :LOCK_SH :LOCK_UN :Lazy :LoadError :LocalJumpError :Location :LockedError :MACCENTEURO :MACCROATIAN :MACCYRILLIC :MACGREEK :MACICELAND :MACJAPAN :MACJAPANESE :MACROMAN :MACROMANIA :MACTHAI :MACTURKISH :MACUKRAINE :MAJOR_VERSION :MANT_DIG :MAPPED :MAX :MAX_10_EXP :MAX_EXP :MIN :MINOR_VERSION :MIN_10_EXP :MIN_EXP :MJIT :MULTILINE :MacCentEuro :MacCroatian :MacCyrillic :MacGreek :MacIceland :MacJapan :MacJapanese :MacRoman :MacRomania :MacThai :MacTurkish :MacUkraine :Marshal :MaskError :MatchData :Math :Method :Module :MovedError :MovedObject :Mutex :NAN :NETWORK_ENDIAN :NOATIME :NOCTTY :NOENCODING :NOERROR :NOFOLLOW :NONBLOCK :NOT_COMPILED_STACK_SIZE :NULL :NameError :NilClass :NoMatchingPatternError :NoMatchingPatternKeyError :NoMemoryError :NoMethodError :Node :NotImplementedError :Numeric :OPTS :Object :ObjectSpace :PAGE_SIZE :PARTIAL_INPUT :PATH_SEPARATOR :PCK :PI :PRIORITY :PRIO_PGRP :PRIO_PROCESS :PRIO_USER :PRIVATE :Pointer :Proc :Process :Producer :Product :Profiler :Queue :RADIX :RB_BUILTIN :RDONLY :RDWR :READABLE :READONLY :RLIMIT_AS :RLIMIT_CORE :RLIMIT_CPU :RLIMIT_DATA :RLIMIT_FSIZE :RLIMIT_MEMLOCK :RLIMIT_MSGQUEUE :RLIMIT_NICE :RLIMIT_NOFILE :RLIMIT_NPROC :RLIMIT_RSS :RLIMIT_RTPRIO :RLIMIT_RTTIME :RLIMIT_SIGPENDING :RLIMIT_STACK :RLIM_INFINITY :RLIM_SAVED_CUR :RLIM_SAVED_MAX :RSYNC :RUBY_COPYRIGHT :RUBY_DESCRIPTION :RUBY_ENGINE :RUBY_ENGINE_VERSION :RUBY_EVENT_CLASS :RUBY_PATCHLEVEL :RUBY_PLATFORM :RUBY_RELEASE_DATE :RUBY_REVISION :RUBY_VERSION :RVALUE_OVERHEAD :RVALUE_SIZE :RVARGC_MAX_ALLOCATE_SIZE :Ractor :Random :Range :RangeError :Rational :Refinement :Regexp :RegexpError :RemoteError :RubyVM :RuntimeError :S16 :S32 :S64 :S8 :SCRIPT_LINES__ :SEEK_CUR :SEEK_DATA :SEEK_END :SEEK_HOLE :SEEK_SET :SEPARATOR :SET :SHAPE_CAPACITY_CHANGE :SHAPE_FLAG_SHIFT :SHAPE_FROZEN :SHAPE_ID_NUM_BITS :SHAPE_INITIAL_CAPACITY :SHAPE_IVAR :SHAPE_MASK :SHAPE_ROOT :SHARED :SHARE_DELETE :SHIFT_JIS :SIZE_POOL_COUNT :SJIS :SJIS_DOCOMO :SJIS_DoCoMo :SJIS_KDDI :SJIS_SOFTBANK :SJIS_SoftBank :STATELESS_ISO_2022_JP :STATELESS_ISO_2022_JP_KDDI :STDERR :STDIN :STDOUT :SYNC :ScriptError :SecurityError :Separator :Set :Shift_JIS :Signal :SignalException :SizedQueue :StandardError :Stat :Stateless_ISO_2022_JP :Stateless_ISO_2022_JP_KDDI :Status :StopIteration :String :Struct :Stub :Symbol :SyntaxError :SyntaxSuggest :Sys :SystemCallError :SystemExit :SystemStackError :TIMES_BASED_CLOCK_MONOTONIC :TIMES_BASED_CLOCK_PROCESS_CPUTIME_ID :TIME_BASED_CLOCK_REALTIME :TIS_620 :TMPFILE :TMP_RUBY_PREFIX :TOPLEVEL_BINDING :TRUNC :Thread :ThreadError :ThreadGroup :Time :TimeoutError :Tms :TracePoint :TrueClass :TypeError :U16 :U32 :U64 :U8 :UCS_2BE :UCS_4BE :UCS_4LE :UID :UNDEF_HEX_CHARREF :UNDEF_MASK :UNDEF_REPLACE :UNIVERSAL_NEWLINE_DECORATOR :USE_LAZY_LOAD :US_ASCII :UTF8_DOCOMO :UTF8_DoCoMo :UTF8_KDDI :UTF8_MAC :UTF8_SOFTBANK :UTF8_SoftBank :UTF_16 :UTF_16BE :UTF_16LE :UTF_32 :UTF_32BE :UTF_32LE :UTF_7 :UTF_8 :UTF_8_HFS :UTF_8_MAC :UnboundMethod :UncaughtThrowError :UndefinedConversionError :UnicodeNormalize :Union :UnsafeError :VALUE :VM_CALL_KW_SPLAT :VM_CALL_KW_SPLAT_bit :VM_CALL_TAILCALL :VM_CALL_TAILCALL_bit :VM_METHOD_TYPE_CFUNC :VM_METHOD_TYPE_ISEQ :WINDOWS_1250 :WINDOWS_1251 :WINDOWS_1252 :WINDOWS_1253 :WINDOWS_1254 :WINDOWS_1255 :WINDOWS_1256 :WINDOWS_1257 :WINDOWS_1258 :WINDOWS_31J :WINDOWS_874 :WNOHANG :WRITABLE :WRONLY :WUNTRACED :WaitReadable :WaitWritable :Waiter :Warning :WeakMap :Windows_1250 :Windows_1251 :Windows_1252 :Windows_1253 :Windows_1254 :Windows_1255 :Windows_1256 :Windows_1257 :Windows_1258 :Windows_31J :Windows_874 :XML_ATTR_CONTENT_DECORATOR :XML_ATTR_QUOTE_DECORATOR :XML_TEXT_DECORATOR :Yielder :ZeroDivisionError :"[" :[] :[]= :"\\" :"]" :^ :_ :_1 :_2 :_3 :_4 :_5 :_6 :_7 :_8 :_9 :_Bool :__attached__ :__autoload__ :__bp__ :__callee__ :__classpath__ :__dir__ :__id__ :__keyword_init__ :__members__ :__members_back__ :__memory_view__ :__method__ :__recursive_key__ :__refined_class__ :__send__ :__tmp_classpath__ :_alloc :_alone :_bf_addr :_captured_body_addr :_cc_addr :_ci_addr :_compiled_body_addr :_dump :_dump_data :_enumerable_collect :_enumerable_collect_concat :_enumerable_drop :_enumerable_drop_while :_enumerable_filter :_enumerable_filter_map :_enumerable_find_all :_enumerable_flat_map :_enumerable_grep :_enumerable_grep_v :_enumerable_map :_enumerable_reject :_enumerable_select :_enumerable_take :_enumerable_take_while :_enumerable_uniq :_enumerable_with_index :_enumerable_zip :_flags :_fork :_id2ref :_iseq_addr :_load :_load_data :_operands_addr :_opes_addr :_separator :_shape_id :_unused1 :_unused2 :: :a :abort :abort_on_exception :abort_on_exception= :abs :abs2 :absolute_path :absolute_path? :accepts_no_kwarg :acos :acosh :add :add_trace_func :addr :address_resolve :advise :after_output :alias :alias_count :alias_method :aliases :alive? :all? :all_symbols :all_tokens :allbits? :allocate :allow_reentry :ambiguous_param0 :ancestors :and :and! :angle :any? :anybits? :append :append_features :arg :argc :args :arguments :argv :argv0 :arity :ary :ascii :ascii_compatible? :ascii_only? :asciicompat_encoding :asctime :asin :asinh :assoc :at :at_exit :atan :atan2 :atanh :atime :attached_object :attr :attr_accessor :attr_index_t :attr_reader :attr_writer :auto_compact :auto_compact= :autoclose :autoclose= :autoclose? :autoload :autoload? :aux :aux_ :b :backtrace :backtrace_location :backtrace_locations :base :base_label :basename :begin :between? :bf_ptr :bin :bind :bind_call :binding :binmode :binmode? :binread :binwrite :birthtime :bit_length :blksize :block :block_code :block_given? :block_start :blockdev? :blocking :blocking? :blocks :bmethod :body :bottom :broadcast :bsearch :bsearch_index :bt :bt_locations :buf :buffer :builtin_compiler :builtin_inline_p :by :byteindex :byteoffset :byterindex :bytes :bytesize :byteslice :bytesplice :call :call_ :call_data :call_threshold :called_id :callee_id :caller :caller_locations :capacity :capitalize :capitalize! :captured_body :captures :casecmp :casecmp? :casefold? :catch :catch_except_p :catch_table :category :cause :cbrt :cc :cc_entries :cc_entries_index :cc_entries_size :cc_ptr :ccan_list_node :cdhash_addr :ceil :ceildiv :center :cfp :cfunc :chain :change_privilege :chardev? :chars :chdir :child :children :chmod :chomp :chomp! :chop :chop! :chown :chr :chroot :chunk :chunk_categorize :chunk_enumerable :chunk_while :ci :ci_ptr :ci_size :clamp :class :class_eval :class_exec :class_variable_defined? :class_variable_get :class_variable_set :class_variables :clear :clock_getres :clock_gettime :clone :close :close_incoming :close_on_exec= :close_on_exec? :close_others :close_outgoing :close_read :close_write :closed? :cme_ :code_location :codepoints :coerce :collect :collect! :collect_concat :combination :compact :compact! :compare_by_identity :compare_by_identity? :compatible :compatible? :compile :compile_branch :compile_data :compile_file :compile_info :compile_option :compile_option= :compile_status :compiled_body :compiled_id :compiled_iseq :compiler :complemented_count :concat :conj :conjugate :const_added :const_defined? :const_get :const_missing :const_set :const_source_location :constants :convert :convpath :copy :copy_stream :"core#define_method" :"core#define_singleton_method" :"core#hash_merge_kwd" :"core#hash_merge_ptr" :"core#raise" :"core#set_method_alias" :"core#set_postexe" :"core#set_variable_alias" :"core#sprintf" :"core#undef_method" :coredump? :cos :cosh :count :count_objects :cover? :coverage :coverage_enabled :cr :cr_newline :cref :crlf :crlf_newline :crypt :cstime :cstime= :ctime :current :current_scheduler :curry :custom :cutime :cutime= :cycle :daemon :day :debug :debug_flags :debug_frozen_string_literal :debug_level :deconstruct :deconstruct_keys :dedup :def :default :default= :default_external :default_external= :default_internal :default_internal= :default_proc :default_proc= :define :define_finalizer :define_method :define_singleton_method :defined_class :delete :delete! :delete_at :delete_if :delete_prefix :delete_prefix! :delete_suffix :delete_suffix! :denominator :deprecate_constant :deprecated :deq :destination_buffer_full :destination_encoding :destination_encoding_name :detach :detailed_message :detect :dev :dev_major :dev_minor :difference :dig :digits :dir :directory? :dirname :disable :disable_const_cache :disable_exivar_cache :disable_inlining :disable_ivar_cache :disable_send_cache :disasm :disassemble :display :div :divmod :dontneed :double_heap :downcase :downcase! :downto :drop :drop_while :dst :dst? :dummy? :dump :dup :e :each :each_byte :each_caller_location :each_char :each_child :each_codepoint :each_cons :each_entry :each_grapheme_cluster :each_index :each_key :each_line :each_object :each_pair :each_slice :each_value :each_with_index :each_with_object :eager :edge_name :edges :egid :egid= :eid :eid= :empty :empty? :enable :enabled? :enclose :enclosed? :encode :encode! :encoded :encoding :end :end_with? :enq :ensure_list :ensure_shareable :entries :entry :enum_for :eof :eof? :ep :eql? :equal? :erf :erfc :err :errinfo :errno :error_bytes :error_char :error_tolerant :escape :euid :euid= :eval :eval_script :even? :event :events :except :exception :excl :exclude_end :exclude_end? :exec :executable? :executable_real? :exist? :exit :exit! :exit_value :exited? :exitstatus :exp :expand_heap :expand_path :experimental :extend :extend_object :extended :external? :external_encoding :extname :f32 :f64 :fail :fallback :fastpath_applied_iseq_p :fatal :fcntl :fdatasync :fdiv :feed :fetch :fetch_values :fiber :fiber_machine_stack_size :fiber_ptr :fiber_vm_stack_size :file :file? :filename :fileno :fill :filter :filter! :filter_map :find :find_all :find_index :find_timezone :finish :finish_p :finished :finite? :first :first_column :first_lineno :fixed_encoding? :flag :flags :flat_map :flatten :flatten! :flip_count :float_microsecond :float_millisecond :float_second :flock :floor :flush :fmt :fnmatch :fnmatch? :fold :for :for_fd :force :force_encoding :foreach :fork :format :free :freeze :frexp :friday? :from_name :from_time :frozen? :frozen_string_literal :fsync :ftype :full_mark :full_message :func_ptr :gamma :garbage_collect :gcd :gcdlcm :get_string :get_value :get_values :getbyte :getc :getegid :geteuid :getgid :getgm :getlocal :getpgid :getpgrp :getpriority :getrlimit :gets :getsid :getuid :getutc :getwd :gid :gid= :glob :global_trace_events :global_variables :gm :gmt? :gmt_offset :gmtime :gmtoff :grant_privilege :grapheme_clusters :grep :grep_v :group :group_by :groups :groups= :grpowned? :gsub :gsub! :handle :handle_interrupt :has_block :has_cache_for_send :has_key? :has_kw :has_kwrest :has_lead :has_opt :has_post :has_rest :has_value? :hash :hash_or_key :heap_name :hertz :hex :hexdump :highlight :home :hour :hypot :i :ic_cache :ic_cref :ic_size :icvarc_size :id :id2name :identical? :ignore_deadlock :ignore_deadlock= :imag :imaginary :immediate :immediate_mark :immediate_sweep :import_methods :in :include :include? :included :included_modules :incomplete_input :incomplete_input? :index :infinite? :inherited :initgroups :initialize :initialize_clone :initialize_copy :initialize_dup :inject :inline_const_cache :inline_context :inlined_call_context :inlined_iseqs :ino :inplace_mode :inplace_mode= :insert :insert_output :insn :insn_may_depend_on_sp_or_pc :insns_info :inspect :instance_eval :instance_exec :instance_method :instance_methods :instance_of? :instance_variable_defined? :instance_variable_get :instance_variable_set :instance_variables :instruction_sequence :instructions_unification :integer? :intern :internal? :internal_encoding :interrupt_flag :interrupt_mask :intersect? :intersection :invalid :invalid_byte_sequence :invert :io_close :io_pread :io_pwrite :io_read :io_select :io_wait :io_write :ioctl :irb :is_a? :is_entries :isatty :isdst :ise_size :iseq :iseq_addr :iseq_bits_t :iseq_catch_table :iseq_compile_data :iseq_encoded :iseq_inline_constant_cache :iseq_inline_constant_cache_entry :iseq_inline_iv_cache_entry :iseq_inline_storage_entry :iseq_insn_info :iseq_overload :iseq_ptr :iseq_size :iseqptr :iseqw :issetugid :iterator? :itself :iv_cache :iv_set_name :ivc_size :jit_func :jit_return :join :keep_if :keep_script_lines :keep_script_lines= :keep_tokens :kernel_sleep :key :key? :keys :keyword :keyword_init? :kill :kind_of? :klass :klass_or_self :kwarg :label :lambda :lambda? :last :last_column :last_error :last_lineno :last_match :last_status :latest_compact_info :latest_gc_info :lazy :lchmod :lchown :lcm :ldexp :lead_num :left :len :length :lf :lf_newline :lgamma :limit :linear_time? :lineno :lineno= :lines :link :list :lithuanian :ljust :load :load_from_binary :load_from_binary_extra_data :load_iseq :loader :loc :local :local_hooks :local_iseq :local_size :local_stack_p :local_storage :local_storage_recursive_hash :local_storage_recursive_hash_for_trace :local_table :local_table_size :local_to_utc :local_variable_defined? :local_variable_get :local_variable_set :local_variables :locale_charmap :locals :localtime :location :lock :locked :locked? :log :log10 :log2 :loop :lstat :lstrip :lstrip! :lutime :machine :magnitude :main :make_shareable :make_shareable_copy :mandatory_only_iseq :map :map! :mapped? :mark_bits :marshal_dump :marshal_load :match :match? :match_length :matchee :max :max= :max_by :max_cache_size :maxgroups :maxgroups= :mday :me :measure_total_time :measure_total_time= :member? :members :memo :merge :merge! :mesg :message :method :method_added :method_defined? :method_id :method_missing :method_missing_reason :method_removed :method_serial :method_undefined :methods :microsecond :mid :millisecond :min :min_by :minmax :minmax_by :mjit_call_attribute_sp_inc :mjit_cancel_all :mjit_capture_cc_entries :mjit_options :mjit_opts :mjit_unit :mkdir :mkfifo :mktime :mode :module_eval :module_exec :module_function :modulo :mon :monday? :month :move :msgs :mtime :n :name :name= :name_list :named_captures :names :nan? :nano_den :nano_num :nanosecond :native_thread_id :negative? :nesting :never :new :new_seed :newline :next :next! :next_float :next_iv_index :next_values :nil :nil? :nlink :no_redef_warning :nobits? :node_id :node_id_for_backtrace_location :non_block :none? :nonzero? :noreuse :normal :normalize :normalized? :not :not! :now :nsec :null? :num_waiting :numerator :obj :object :object_id :objs :oct :odd? :of :offset :on :on_blocking :once :one? :open :open_args :operands :operands_unification :opes :opt_num :opt_table :optimized :options :or :or! :ord :orig_argc :original_id :original_iseq :original_name :other :out :outer_variables :owned? :owner :p :pack :param :param_size :parameters :parent_id :parent_iseq :parse :parse_file :partial_input :partition :pass :passed_block_handler :path :pathname :pathobj :pattern :pause :pc :pc2branchindex :peek :peek_values :peephole_optimization :pending_interrupt? :perm :permutation :pgroup :phase :pid :pipe :pipe? :polar :pool :pop :popen :pos :pos= :positive? :post_match :post_num :post_start :pow :pp :ppid :pre_match :pread :precision :pred :prepend :prepend_features :prepended :prev_float :primitive_convert :primitive_errinfo :print :printf :priority :priority= :private :private_call? :private_class_method :private_const_reference :private_constant :private_instance_methods :private_method_defined? :private_methods :proc :process_wait :produce :product :protected :protected_instance_methods :protected_method_defined? :protected_methods :public :public_class_method :public_constant :public_instance_method :public_instance_methods :public_method :public_method_defined? :public_methods :public_send :push :putback :putc :puts :pwd :pwrite :quo :quote :ractor :ractors :raise :raised_exception :raised_flag :rand :random :random_number :rassoc :rationalize :raw_data :rb_atomic_t :rb_builtin_function :rb_cFalseClass :rb_cFloat :rb_cInteger :rb_cNilClass :rb_cSymbol :rb_cTrueClass :rb_call_data :rb_callable_method_entry_struct :rb_callcache :rb_callinfo :rb_callinfo_kwarg :rb_code_location_t :rb_control_frame_t :rb_cref_struct :rb_cref_t :rb_ensure_list_t :rb_event_flag_t :rb_execution_context_struct :rb_execution_context_t :rb_fiber_t :rb_hash_values :rb_hook_list_struct :rb_id_table :rb_iseq_check :rb_iseq_constant_body :rb_iseq_first_lineno :rb_iseq_location_t :rb_iseq_param_keyword :rb_iseq_path :rb_iseq_struct :rb_iseq_t :rb_iseq_type :rb_iseqw_to_iseq :rb_method_alias_t :rb_method_attr_t :rb_method_bmethod_t :rb_method_cfunc_t :rb_method_definition_struct :rb_method_iseq_t :rb_method_optimized_t :rb_method_refined_t :rb_method_type_t :rb_mjit_compile_info :rb_mjit_unit :rb_mjit_unit_list :rb_mjit_unit_type :rb_scope_visibility_t :rb_serial_t :rb_shape :rb_shape_get_shape_by_id :rb_shape_t :rb_snum_t :rb_splat_or_kwargs_p :rb_thread_struct :rb_trace_arg_struct :rb_vm_insn_decode :rb_vm_insn_encode :rb_vm_tag :rdev :rdev_major :rdev_minor :re_exchange :re_exchangeable? :read :read_nonblock :readable? :readable_real? :readagain_bytes :readbyte :readchar :readline :readlines :readlink :readonly? :readpartial :real :real? :realdirpath :realpath :reason :receive :receive_if :receiver :rect :rectangular :recv :reduce :refine :refined :refined_class :refinements :regexp :rehash :reject :reject! :remainder :remove_class_variable :remove_const :remove_instance_variable :remove_method :rename :reopen :repeated_combination :repeated_permutation :replace :replacement :replacement= :replicate :report :report_on_exception :report_on_exception= :require :require_relative :resize :resolve_feature_path :respond_to? :respond_to_missing? :rest_start :restore :result :resume :return_value :reverse :reverse! :reverse_each :rewind :rid :rindex :rjust :rmdir :root_lep :root_svar :rotate :rotate! :round :rpartition :rstrip :rstrip! :ruby2_keywords :ruby2_keywords_hash :ruby2_keywords_hash? :run :running_thread :s :s16 :s32 :s64 :sample :saturday? :save_temps :scan :schedule :scheduler :scheduler_close :scope_visi :script_lines :scrub :scrub! :search_convpath :sec :second :seed :seek :segments :select :select! :self :send :sequential :set_backtrace :set_encoding :set_encoding_by_bom :set_scheduler :set_string :set_trace_func :set_value :set_values :setbyte :setegid :seteuid :setgid :setgid? :setpgid :setpgrp :setpriority :setproctitle :setregid :setresgid :setresuid :setreuid :setrgid :setrlimit :setruid :setsid :setuid :setuid? :shape_addr :shape_id :shape_id_t :shareable? :shared? :shift :shuffle :shuffle! :sid_available? :signal :signaled? :signame :signm :signo :sin :single :singleton_class :singleton_class? :singleton_method :singleton_method_added :singleton_method_removed :singleton_method_undefined :singleton_methods :singletonclass :sinh :size :size? :size_of :size_pool_index :skip :sleep :slice :slice! :slice_after :slice_before :slice_when :sliceafter_enum :sliceafter_pat :sliceafter_pred :slicebefore_enumerable :slicebefore_sep_pat :slicebefore_sep_pred :slicewhen_enum :slicewhen_inverted :slicewhen_pred :socket? :sort :sort! :sort_by :sort_by! :source :source_buffer_empty :source_encoding :source_encoding_name :source_location :sp :spawn :specialized_instruction :split :sprintf :sqrt :squeeze :squeeze! :srand :stack_caching :stack_end :stack_max :stack_maxsize :stack_size :stack_size_for_pos :stack_start :start :start_with? :stat :stat_heap :state :status :step :sticky? :stime :stime= :stop :stop? :stopped? :stopsig :storage :storage= :store :str :stress :stress= :strftime :string :strip :strip! :sub :sub! :subclasses :submicro :subsec :succ :succ! :success :success? :sum :sunday? :super_method :superclass :swapcase :swapcase! :switch :sym :symlink :symlink? :sync :sync= :synchronize :syscall :sysopen :sysread :sysseek :system :syswrite :tag :tailcall_optimization :take :take_while :tally :tan :tanh :tap :target :target_line :target_thread :tell :terminate :termsig :test :text :textmode :then :thread_machine_stack_size :thread_ptr :thread_variable? :thread_variable_get :thread_variable_set :thread_variables :thread_vm_stack_size :throw :thursday? :time :timeout :timeout= :timeout_after :times :tm :to :to_a :to_ary :to_binary :to_c :to_enum :to_f :to_h :to_hash :to_i :to_int :to_io :to_path :to_proc :to_r :to_ruby :to_s :to_set :to_str :to_sym :to_time :to_tty? :to_write_io :token :tokens :top :total_calls :total_time :toward :tr :tr! :tr_s :tr_s! :trace :trace_arg :trace_points :trace_var :transfer :transform_keys :transform_keys! :transform_values :transform_values! :translate :transpose :trap :truncate :try_convert :try_lock :tty? :tuesday? :turkic :tv_nsec :tv_sec :tv_usec :type :u16 :u32 :u64 :uid :uid= :umask :unbind :unblock :undef :undef_method :undefine_finalizer :undefined_conversion :undefined_instance_methods :undump :ungetbyte :ungetc :unicode_normalize :unicode_normalize! :unicode_normalized? :union :uniq :uniq! :unit :units :universal :universal_newline :unlink :unlock :unode :unpack :unpack1 :unsetenv_others :unshift :untrace_var :upcase :upcase! :update :uplevel :upto :urandom :usec :used_code_p :used_modules :used_refinements :using :using_rvargc? :utc :utc? :utc_offset :utc_to_local :utime :utime= :v :val :valid? :valid_encoding? :value :value? :values :values_at :variable :verbose :verify_compaction_references :verify_internal_consistency :verify_transient_heap_internal_consistency :vm_call_handler :vm_ci_argc :vm_ci_flag :vm_stack :vm_stack_size :wait :wait2 :wait_priority :wait_readable :wait_writable :waitall :waitpid :waitpid2 :wakeup :warn :warnings :wday :wednesday? :willneed :with :with_index :with_object :world_readable? :world_writable? :wrapper :writable? :writable_real? :write :write_nonblock :xml :xor! :yday :year :yield :yield_self :yield_unspecified :yield_value :zero? :zip :zone :"{" :| :"||" :"}" :~

Initial Global/Special Variables

More info

$ ruby --disable-all -e 'puts global_variables.sort.
map{ |g| "`#{g.to_s.sub("`", "\\`")}`" }.join(", ")'

$!, $", $$, $&, $', $*, $+, $,, $-0, $-F, $-I, $-W, $-a, $-d, $-i, $-l, $-p, $-v, $-w, $., $/, $0, $:, $;, $<, $=, $>, $?, $@, $DEBUG, $FILENAME, $LOADED_FEATURES, $LOAD_PATH, $PROGRAM_NAME, $VERBOSE, $\, $_, $$, $stderr, $stdin, $stdout, $~

Also See

More Idiosyncratic Ruby