Skip to content
Please note that GitHub no longer supports your web browser.

We recommend upgrading to the latest Google Chrome or Firefox.

Learn more
The Ruby Programming Language [mirror]
Ruby C Yacc Objective-C Makefile M4 Other
Branch: master
Clone or download
znz Revert a6e3285 partially
Fix TypeError when typing `''.[TAB]`
Latest commit a4a2dd7 Aug 9, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows Add more runners Aug 9, 2019
basictest colors file has been moved from test to tool Jul 2, 2019
benchmark n+1 to include n in range Aug 5, 2019
bin Added binstub for racc executables. Jun 19, 2019
bootstraptest bootstraptest/test_insns.rb: test opt_nil_p Aug 1, 2019
ccan ccan/list: sync with upstream Feb 1, 2018
coroutine Add assertions to `coroutine_initialize_main`. Jul 19, 2019
coverage Fix typo May 21, 2019
cygwin MFLAGS for nmake Feb 10, 2017
defs Remove temporary directory [ci skip] Aug 8, 2019
doc Use the word heredocs in Here Documents docs Aug 4, 2019
enc Include ruby/assert.h in ruby/ruby.h so that assertions can be there Jul 14, 2019
ext ext/ripper/lib/ripper/lexer.rb: Consistently use `Array#push` Aug 6, 2019
gems Update rake-12.3.3. Jul 22, 2019
include The value of rb_scan_args_verify is never used Aug 6, 2019
lib Revert a6e3285 partially Aug 9, 2019
libexec [bundler/bundler] Revert "Migrate requires from exe/ to also be relat… Aug 3, 2019
man [bundler/bundler] Fix typo in binstubs documentation Aug 3, 2019
misc add FROZEN to lldb debug output May 9, 2019
missing Split procstat_vm.c Feb 7, 2019
sample For this may be a syntax error (instead of LocalJumpError) in Ruby 2.7 Feb 4, 2019
spec Suppress warnings against locations in eval Aug 3, 2019
template test-bundled-gems-run: Respect -k option Jul 24, 2019
test extend timeout to debug. Aug 9, 2019
tool complement `test_` prefix. Aug 9, 2019
win32 [DOC] "nmake check" is preferable to "nmake exam" now [ci skip] Aug 3, 2019
.dir-locals.el add .dir-locals.el [ci skip] Dec 27, 2018
.document Include LEGAL in .document [ci skip] Dec 1, 2018
.editorconfig Remove duplicated and change order Mar 21, 2019
.gdbinit Prefix global_symbols with `ruby_` May 16, 2019
.gitattributes Add tool/leaked-globals to .gitattributes [ci skip] Jul 15, 2019
.gitignore Only ignore build directories. Jun 20, 2019
.indent.pro * .indent.pro: added for ruby-style. Mar 11, 2010
.travis.yml Refactor .travis.yml by introducing travis_retry.sh Aug 7, 2019
BSDL * BSDL: update copyright notice for 2013. Feb 9, 2013
CONTRIBUTING.md [DOC] Please see _the_ official issue tracker... [ci skip] Jun 13, 2014
COPYING COPYING: reformat as RDoc Feb 2, 2019
COPYING.ja COPYING: reformat as RDoc Feb 2, 2019
GPL * GPL: update text of GPLv2. [ruby-core:44488] [Bug #6328] Jun 3, 2012
KNOWNBUGS.rb compile.c: fix positions encode Apr 5, 2018
LEGAL Split procstat_vm.c Feb 7, 2019
NEWS Add details of fiber pool and coroutine selection to NEWS. Jul 18, 2019
README.EXT README.EXT: add redirect [ruby-core:68631] Mar 25, 2015
README.EXT.ja README.EXT.ja: add redirect [ruby-core:68631] Mar 30, 2015
README.ja.md Prefer master rather than trunk in README [ci skip] Jun 30, 2019
README.md README: Add smart URL for joining mailing list Aug 4, 2019
aclocal.m4 configure.ac: check finite,isinf,isnan as macros first Feb 8, 2019
addr2line.c addr2line.c: clarify the type of integer expression Jul 14, 2019
addr2line.h Support Mach-O on backtrace with DWARF Oct 20, 2018
appveyor.yml Revert "Drop -j from msys2 build for debugging" Aug 8, 2019
array.c array.c: gc.h is not needed Aug 7, 2019
ast.c Support memsize of AST Jul 23, 2019
azure-pipelines.yml Try giving up `brew update` in Azure as well Jul 30, 2019
bignum.c * expand tabs. Aug 3, 2019
class.c remove useless include and dependency Aug 9, 2019
common.mk gc.h is required on mswin build. Aug 9, 2019
compar.c Clarify requirements of <=> Apr 22, 2019
compile.c * expand tabs. Aug 8, 2019
complex.c Predefine some IDs Aug 3, 2019
configure.ac Relaxed target_os matching Jul 23, 2019
constant.h Module#constant_source_location [Feature #10771] Jun 22, 2019
cont.c Fix unused variable Jul 29, 2019
debug.c internal.h: remove dependecy on ruby/io.h Jan 9, 2018
debug_counter.c Add a way to print debug counters without exiting Aug 7, 2019
debug_counter.h Add a way to print debug counters without exiting Aug 7, 2019
dir.c dir.c (dir_each_entry): remove unnecessary check Jul 14, 2019
dln.c Remove IA64 support. Jun 19, 2019
dln.h dln.c: extra arguments Jun 30, 2013
dln_find.c dln_find.c: MAXPATHLEN is not used already Jun 2, 2016
dmydln.c UNREACHABLE_RETURN Jul 24, 2018
dmyenc.c load.c: tweak the return value Dec 3, 2014
dmyext.c dmyenc.c: separate Nov 27, 2014
encindex.h encoding.c: rb_enc_find_index2 Dec 22, 2017
encoding.c Better wording for __ENCODING__ Aug 4, 2019
enum.c enum.c: Remove unused #include Aug 7, 2019
enumerator.c Use predefined idTo_proc Aug 1, 2019
error.c Predefine some IDs Aug 3, 2019
eval.c Adjust documentation for Kernel#raise [ci skip] Jul 22, 2019
eval_error.c Removed duplicate highlighting Jul 15, 2019
eval_intern.h solve "duplicate :raise event" [Bug #15877] Aug 8, 2019
eval_jump.c `$SAFE` as a process global state. [Feature #14250] Dec 28, 2017
file.c Do not always taint the result of File#path Jul 30, 2019
gc.c Extracted wmap_live_p Aug 6, 2019
gc.h add rp() and bp() in internal.h. Aug 9, 2019
gem_prelude.rb Reduce system calls by activating the `did_you_mean` gem. Feb 25, 2016
golf_prelude.rb golf_prelude.rb: suppress the redefining warning Jun 22, 2019
goruby.c goruby.c: FD leak [ci skip] Mar 9, 2017
hash.c hash.c: gc.h is needed when HASH_DEBUG mode Aug 7, 2019
hrtime.h hrtime.h: fix typo in non-builtin overflow check Aug 30, 2018
id_table.c Add `GC.compact` again. Apr 20, 2019
id_table.h Add `GC.compact` again. Apr 20, 2019
inits.c Explicitly initialise encodings on init to remove branches on encodin… Jul 23, 2019
insns.def leafify opt_plus Aug 6, 2019
internal.h add rp() and bp() in internal.h. Aug 9, 2019
io.c * expand tabs. Jul 30, 2019
iseq.c Document that RubyVM::InstructionSequence methods are implementation … Aug 5, 2019
iseq.h Add `GC.compact` again. Apr 20, 2019
lex.c.blt keywords: shrink struct kwtable Jan 21, 2018
load.c Should require without wrapper module Aug 8, 2019
loadpath.c -Wno-overlength-strings Jan 16, 2018
localeinit.c internal.h: remove dependecy on ruby/encoding.h Jan 9, 2018
main.c main.c: Add doxygen mainpage Aug 8, 2019
marshal.c * expand tabs. Jul 31, 2019
math.c math.c: adjust cbrt Jun 6, 2018
method.h Stop packing rb_method_definition_t Jul 22, 2019
miniinit.c miniinit.c: built-in encoding aliases Dec 26, 2015
mjit.c Rename rb_gc_new_location to rb_gc_location May 18, 2019
mjit.h Rename mjit_gc_finish_hook to mjit_gc_exit_hook May 16, 2019
mjit_compile.c Just disable inlining with local varaible for now Jul 3, 2019
mjit_worker.c Handle failure of opening a null device Jul 15, 2019
node.c Let memory sizes of the various IMEMO object types be reflected corre… Jul 23, 2019
node.h Let memory sizes of the various IMEMO object types be reflected corre… Jul 23, 2019
numeric.c Deprecate Float::ROUNDS, which should not be a constant Aug 6, 2019
object.c Revert "Revert "Add a specialized instruction for `.nil?` calls"" Aug 2, 2019
pack.c Fix documentation for Array#pack m directive count specifier [ci skip] Jul 22, 2019
parse.y Revert "Revert "Fix dangling path name from fstring"" Aug 4, 2019
prelude.rb Document that non-blocking mode isn't always supported on Windows [ci… Jul 23, 2019
probes.d change lingering dtrace probe documentation from function- to method- May 30, 2015
probes_helper.h vm.c: disable dtrace in jit source Feb 20, 2018
proc.c fix typos. Jul 14, 2019
process.c nil as the default of optional parameters Jul 16, 2019
random.c * expand tabs. Jun 4, 2019
range.c Document that Range#cover? returns false if <=> returns nil Jul 24, 2019
rational.c Predefine some IDs Aug 3, 2019
re.c Reuse match data Jul 27, 2019
regcomp.c Fix issues detected by code analysis tool (mainly Coverity). Sep 15, 2018
regenc.c Merge Onigmo 6.1.1 Feb 11, 2017
regenc.h initializer paren-string `{("str")}` is a C99ism Jan 2, 2018
regerror.c Escape control codes in regexp warning message Jun 29, 2019
regexec.c Only define history_root member of the Oniguruma re_registers struct … Apr 23, 2019
regint.h Merge Onigmo 6.1.1 Feb 11, 2017
regparse.c Fixed String#grapheme_clusters with wide encodings Jun 29, 2019
regparse.h Fix typos. Jan 18, 2018
regsyntax.c Merge Onigmo 6.0.0 Dec 10, 2016
ruby-runner.c Give the MJIT header path name Dec 8, 2018
ruby.c ruby.c (name_match_p): remove unnecessary condition Jul 14, 2019
ruby_assert.h respect NDEBUG. Jul 19, 2019
ruby_atomic.h move atomic logic from mjit.c from ruby_atomic.h Aug 1, 2018
rubystub.c rubystub.c: sys/param.h for MAXPATHLEN Aug 20, 2016
safe.c `$SAFE` as a process global state. [Feature #14250] Dec 28, 2017
signal.c * expand tabs. Aug 1, 2019
siphash.c switch SipHash from SipHash24 to SipHash13 variant Jan 20, 2017
siphash.h blacklist UBSAN's unsigned integer overflow Nov 7, 2018
sparc.c configure.ac Sep 29, 2017
sprintf.c Add /* fall through */ comments Jul 14, 2019
st.c Add `GC.compact` again. Apr 20, 2019
strftime.c Prefer `rb_fstring_lit` over `rb_fstring_cstr` Oct 13, 2018
string.c leafify opt_plus Aug 6, 2019
struct.c Define Struct#deconstruct Apr 17, 2019
symbol.c Prefix global_symbols with `ruby_` May 16, 2019
symbol.h Add RB_ID_SERIAL_MAX Apr 25, 2019
thread.c gc.h is required on mswin build. Aug 9, 2019
thread_pthread.c * expand tabs. Jun 19, 2019
thread_pthread.h thread_pthread.h: rename `gvl.acquired' to `gvl.owner' and document Aug 28, 2018
thread_sync.c do_mutex_lock: release mutex before checking for interrupts (fixes is… Jun 11, 2019
thread_win32.c Remove IA64 support. Jun 19, 2019
thread_win32.h * ext/openssl/depend: remove dependency from internal headers. May 14, 2014
time.c Refine time_to_r Aug 6, 2019
timev.h timev.h: dummy definition for TAGS Apr 10, 2019
transcode.c transcode.c (rb_econv_open0): remove unused code Jul 23, 2019
transcode_data.h transcode_data.h: missing cast Aug 8, 2015
transient_heap.c prefix ASAN related inline functions asan_ May 23, 2019
transient_heap.h Add `GC.compact` again. Apr 20, 2019
util.c Split dtoa.c Feb 7, 2019
variable.c remove RHash::iter_lev. Jul 31, 2019
version.c Update RDoc of RUBY_REVISION Jun 5, 2019
version.h * 2019-08-09 Aug 8, 2019
vm.c solve "duplicate :raise event" [Bug #15877] Aug 8, 2019
vm_args.c update Array's length correctly. May 23, 2019
vm_backtrace.c * expand tabs. Aug 1, 2019
vm_core.h Revert "Revert "Add a specialized instruction for `.nil?` calls"" Aug 2, 2019
vm_debug.h add rp() and bp() in internal.h. Aug 9, 2019
vm_dump.c Remove IA64 support. Jun 19, 2019
vm_eval.c Revert "Revert "Fix dangling path name from fstring"" Aug 4, 2019
vm_exec.c vm_exec.c: reduced repeated same calls Mar 4, 2018
vm_exec.h use __GNUC__ instead of __GCC__. Mar 8, 2019
vm_insnhelper.c * expand tabs. Aug 9, 2019
vm_insnhelper.h Initialize vm_throw_data::throw_state as int Jul 25, 2019
vm_method.c Make attr* methods define public methods if self in caller is not sam… Aug 1, 2019
vm_opts.h vm_opts.h: share USE_IC_FOR_IVAR as OPT_IC_FOR_IVAR Oct 14, 2018
vm_trace.c should not free local hook_list here. Jul 23, 2019
vsnprintf.c give up sanitizing BSD_vfprintf Apr 26, 2019
wercker.yml Generalize timeout_scale Jun 11, 2019

README.md

Build Status wercker status Build status Build Status

What's Ruby

Ruby is an interpreted object-oriented programming language often used for web development. It also offers many scripting features to process plain text and serialized files, or manage system tasks. It is simple, straightforward, and extensible.

Features of Ruby

  • Simple Syntax
  • Normal Object-oriented Features (e.g. class, method calls)
  • Advanced Object-oriented Features (e.g. mix-in, singleton-method)
  • Operator Overloading
  • Exception Handling
  • Iterators and Closures
  • Garbage Collection
  • Dynamic Loading of Object Files (on some architectures)
  • Highly Portable (works on many Unix-like/POSIX compatible platforms as well as Windows, macOS, Haiku, etc.) cf. https://github.com/ruby/ruby/blob/master/doc/contributing.rdoc#platform-maintainers

How to get Ruby

For a complete list of ways to install Ruby, including using third-party tools like rvm, see:

https://www.ruby-lang.org/en/downloads/

Git

The mirror of the Ruby source tree can be checked out with the following command:

$ git clone https://github.com/ruby/ruby.git

There are some other branches under development. Try the following command to see the list of branches:

$ git ls-remote https://github.com/ruby/ruby.git

You may also want to use https://git.ruby-lang.org/ruby.git (actual master of Ruby source) if you are a committer.

Subversion

Stable branches for older Ruby versions can be checked out with the following command:

$ svn co https://svn.ruby-lang.org/repos/ruby/branches/ruby_2_6/ ruby

Try the following command to see the list of branches:

$ svn ls https://svn.ruby-lang.org/repos/ruby/branches/

Ruby home page

https://www.ruby-lang.org/

Mailing list

There is a mailing list to discuss Ruby. To subscribe to this list, please send the following phrase:

subscribe

in the mail body (not subject) to the address ruby-talk-request@ruby-lang.org.

How to compile and install

  1. If you want to use Microsoft Visual C++ to compile Ruby, read win32/README.win32 instead of this document.

  2. If ./configure does not exist or is older than configure.ac, run autoconf to (re)generate configure.

  3. Run ./configure, which will generate config.h and Makefile.

    Some C compiler flags may be added by default depending on your environment. Specify optflags=.. and warnflags=.. as necessary to override them.

  4. Edit defines.h if you need. Usually this step will not be needed.

  5. Remove comment mark(#) before the module names from ext/Setup (or add module names if not present), if you want to link modules statically.

    If you don't want to compile non static extension modules (probably on architectures which do not allow dynamic loading), remove comment mark from the line "#option nodynamic" in ext/Setup.

    Usually this step will not be needed.

  6. Run make.

    • On Mac, set RUBY_CODESIGN environment variable with a signing identity. It uses the identity to sign ruby binary. See also codesign(1).
  7. Optionally, run 'make check' to check whether the compiled Ruby interpreter works well. If you see the message "check succeeded", your Ruby works as it should (hopefully).

  8. Optionally, run make update-gems and make extract-gems.

    If you want to install bundled gems, run make update-gems and make extract-gems before running make install.

  9. Run 'make install'.

    This command will create the following directories and install files into them.

    • ${DESTDIR}${prefix}/bin
    • ${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}
    • ${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}
    • ${DESTDIR}${prefix}/lib
    • ${DESTDIR}${prefix}/lib/ruby
    • ${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}
    • ${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}
    • ${DESTDIR}${prefix}/lib/ruby/site_ruby
    • ${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}
    • ${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}
    • ${DESTDIR}${prefix}/lib/ruby/vendor_ruby
    • ${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}
    • ${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}
    • ${DESTDIR}${prefix}/lib/ruby/gems/${MAJOR}.${MINOR}.${TEENY}
    • ${DESTDIR}${prefix}/share/man/man1
    • ${DESTDIR}${prefix}/share/ri/${MAJOR}.${MINOR}.${TEENY}/system

    If Ruby's API version is 'x.y.z', the ${MAJOR} is 'x', the ${MINOR} is 'y', and the ${TEENY} is 'z'.

    NOTE: teeny of the API version may be different from one of Ruby's program version

    You may have to be a super user to install Ruby.

If you fail to compile Ruby, please send the detailed error report with the error log and machine/OS type, to help others.

Some extension libraries may not get compiled because of lack of necessary external libraries and/or headers, then you will need to run 'make distclean-ext' to remove old configuration after installing them in such case.

Copying

See the file COPYING.

Feedback

Questions about the Ruby language can be asked on the Ruby-Talk mailing list (https://www.ruby-lang.org/en/community/mailing-lists) or on websites like (https://stackoverflow.com).

Bugs should be reported at https://bugs.ruby-lang.org. Read HowToReport for more information.

Contributing

See the file CONTRIBUTING.md

The Author

Ruby was originally designed and developed by Yukihiro Matsumoto (Matz) in 1995.

matz@ruby-lang.org

You can’t perform that action at this time.