The Ruby Programming Language
Ruby C Objective-C Yacc Makefile Emacs Lisp Other
Switch branches/tags
Clone or download
Pull request Compare This branch is 103 commits ahead, 2670 commits behind ruby:trunk.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
basictest basictest: --run-opt option Oct 19, 2016
benchmark Lazy Proc allocation for block parameters Oct 24, 2017
bin Postponing the Bundler merge. Dec 22, 2017
bootstraptest show the location at intterrupted Nov 6, 2017
ccan ccan/list/list.h: suppress unused argument warnings Sep 6, 2015
coverage fix a typo [ci skip] Sep 12, 2014
cygwin MFLAGS for nmake Feb 10, 2017
defs Postponing the Bundler merge. Dec 22, 2017
doc doc/contributing.rdoc: Update platform maintainers Dec 25, 2017
enc gperf.sed: static declarations Dec 15, 2017
ext merge revision(s) 63304: [Backport #14713] Jul 12, 2018
gems * gems/bundled_gems: Upgrade the did_you_mean gem to 1.2.0 Dec 14, 2017
include merge revision(s) 62116,62151: [Backport #14425] Feb 20, 2018
lib revert r62985 (r62966 in trunk) Mar 28, 2018
man erb.1: add missing option in detailed description Oct 21, 2017
misc ruby-additional.el: shorten here-doc markers Oct 2, 2017
missing Support C89 if possible Dec 18, 2017
sample Remove unnecessary `require 'thread'` Oct 8, 2017
spec merge revision(s) 62731,62735: [Backport #14495] Jul 12, 2018
template merge revision(s) 61478: [Backport #14234] Dec 27, 2017
test variable.c: fix thread + fork errors in autoload Jul 24, 2018
tool Postponing the Bundler merge. Dec 22, 2017
win32 set ino at `File.lstat` on Windows Dec 12, 2017
.document Exclude Changelog files from documentation. Sep 1, 2017
.editorconfig Add *.gemspec to .editorconfig [ci skip] Sep 12, 2017
.gdbinit .gdbinit: fix print_pathobj Nov 18, 2017
.gitattributes rename ruby-runner as bin/ruby Sep 15, 2017
.gitignore .gitignore: ignore dlntest.dll Nov 12, 2017
.indent.pro * .indent.pro: added for ruby-style. Mar 11, 2010
.travis.yml merge revision(s) 61470: Jul 12, 2018
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: expand tabs Feb 18, 2017
COPYING.ja Change encoding from EUC-JP to UTF-8. [Feature #5128] Sep 4, 2011
GPL * GPL: update text of GPLv2. [ruby-core:44488] [Bug #6328] Jun 3, 2012
KNOWNBUGS.rb gc.c: expand sorted pages Jun 22, 2017
LEGAL merge revision(s) 62513: [Backport #12762] Feb 24, 2018
Makefile.in support gperf 3.1 Dec 8, 2017
NEWS merge revision(s) 63048: [Backport #14654] Jul 12, 2018
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 configure.ac Sep 29, 2017
README.md Modify git clone command Dec 13, 2017
acinclude.m4 acinclude.m4: rename Jan 3, 2016
aclocal.m4 configure.ac Sep 29, 2017
addr2line.c Support C89 if possible Dec 18, 2017
addr2line.h * addr2line.c (fill_lines): loop reverse order not to overwrite Mar 26, 2014
appveyor.yml Remove DevKit path, change zlib link Sep 27, 2017
array.c merge revision(s) 61561: [Backport #14272] Jan 7, 2018
bignum.c merge revision(s) 61517: [Backport #14259] Jan 5, 2018
class.c non-keywords hash Aug 20, 2017
common.mk merge revision(s) 61645: [Backport #14333] Feb 19, 2018
compar.c Comparable#clamp Aug 11, 2016
compile.c merge revision(s) 61587,61617,61618: [Backport #14273] Mar 24, 2018
complex.c merge revision(s) 62107: [Backport #14420] Feb 22, 2018
configure.ac merge revision(s) 61500: [Backport #14248] Jan 3, 2018
constant.h merge revision(s) 62394,62395: [Backport #14469] Mar 15, 2018
cont.c cont.c: update comment for ec refactoring Dec 6, 2017
debug.c debug.c: include RIMemo in ruby_dummy_gdb_enums Nov 23, 2017
debug_counter.c debug_counter.c: debug_counter_names [ci skip] Mar 10, 2017
debug_counter.h rename absolute_path to realpath internally and introduce pathobj. Jun 1, 2017
dir.c dir.c: check NUL bytes Mar 28, 2018
dln.c get rid of strcpy Dec 26, 2016
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 * configure.in: add -Wsuggest-attribute=noreturn and suppress warnings. May 8, 2016
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 encoding.c: rb_enc_find_index2 Dec 22, 2017
enum.c enum.c: improve docs for Enumerable#{any?,all?,none?,one?} Dec 14, 2017
enumerator.c merge revision(s) 62731,62735: [Backport #14495] Jul 12, 2018
error.c merge revision(s) 61525,61527,63062,63650: [Backport #14846] Jul 12, 2018
eval.c remove `PUSH_TAG`/`EXEC_AG`/`POP_TAG`/`JUMO_TAG`. Dec 6, 2017
eval_error.c merge revision(s) 62548,62894: [Backport #14324] Mar 24, 2018
eval_intern.h eval_intern.h: fix a typo Dec 6, 2017
eval_jump.c remove `PUSH_TAG`/`EXEC_AG`/`POP_TAG`/`JUMO_TAG`. Dec 6, 2017
file.c merge revision(s) 62606,62607: [Backport #14557] Mar 2, 2018
gc.c Include the alternative malloc header instead of malloc.h Jul 20, 2018
gc.h remove rb_threadptr_during_gc(). Oct 29, 2017
gem_prelude.rb Reduce system calls by activating the `did_you_mean` gem. Feb 25, 2016
golf_prelude.rb Use `%i`-literal instead of array of symbols Sep 7, 2017
goruby.c goruby.c: FD leak [ci skip] Mar 9, 2017
hash.c merge revision(s) 62042,62044: [Backport #14380] Mar 22, 2018
ia64.s * removed trailing spaces. Jun 9, 2012
id_table.c adjust styles [ci skip] May 10, 2017
id_table.h id_table.h: dummy sentinel Aug 6, 2016
inits.c Revert "Improve performance of creating Hash object" Dec 19, 2017
insns.def insns.def: adjust type Dec 23, 2017
internal.h merge revision(s) 61616: [Backport #14314] Feb 16, 2018
io.c merge revision(s) 63304: [Backport #14713] Jul 12, 2018
iseq.c merge revision(s) 61591: [Backport #14312] Feb 18, 2018
iseq.h Remove "trace_instruction" compile option. Dec 24, 2017
lex.c.blt gperf.sed: static declarations Dec 15, 2017
load.c remove `PUSH_TAG`/`EXEC_AG`/`POP_TAG`/`JUMO_TAG`. Dec 6, 2017
loadpath.c * loadpath.c (RUBY_REVISION): Defined to suppress revision.h Jun 17, 2013
localeinit.c debug.c: parse locale and filesystem codepages Jun 6, 2017
main.c main.c: RUBY_DEBUG_ENV in devel Jun 30, 2017
marshal.c merge revision(s) 61616: [Backport #14314] Feb 16, 2018
math.c math.c: check argument to lgamma_r May 13, 2017
method.h vm_core.h (rb_iseq_locatoin_t): add a field `code_range` Dec 5, 2017
miniinit.c miniinit.c: built-in encoding aliases Dec 26, 2015
node.c node.c: show variable type for NODE_*ASGN Dec 15, 2017
node.h node.h: add nd_last_loc and nd_set_last_loc Dec 14, 2017
numeric.c Integer#{any|all|no}_bits: Fix coercion. Add specs [#12753] Dec 17, 2017
object.c Add FrozenError as a subclass of RuntimeError Dec 12, 2017
pack.c pack.c: fix underflow Mar 28, 2018
parse.y merge revision(s) 62723,62724: [Backport #14584] Mar 24, 2018
prelude.rb prelude.rb: block passing Dec 25, 2017
probes.d change lingering dtrace probe documentation from function- to method- May 30, 2015
probes_helper.h th->ec: dtrace Nov 7, 2017
proc.c merge revision(s) 62115: [Backport #14421] Feb 21, 2018
process.c process.c: [DOC] fix grammar and double negative Dec 14, 2017
random.c random.c: make sure that Random.urandom returns required-length buffer Dec 16, 2017
range.c range.c: use rb_check_funcall Oct 25, 2017
rational.c merge revision(s) 62555: [Backport #14547] Feb 24, 2018
re.c [DOC] Fix exception class [ci skip] Dec 13, 2017
regcomp.c Merge Onigmo 6.1.1 Feb 11, 2017
regenc.c Merge Onigmo 6.1.1 Feb 11, 2017
regenc.h fix UTF-32 valid_encoding? Mar 9, 2017
regerror.c get rid of strcat Dec 26, 2016
regexec.c re-apply r60755 Dec 1, 2017
regint.h Merge Onigmo 6.1.1 Feb 11, 2017
regparse.c Update to Onigmo 6.1.3-669ac9997619954c298da971fcfacccf36909d05. Dec 1, 2017
regparse.h Merge Onigmo 6.1.1 Feb 11, 2017
regsyntax.c Merge Onigmo 6.0.0 Dec 10, 2016
ruby-runner.c ruby-runner.c: RUBYLIB Sep 24, 2017
ruby.c ruby.c: script __dir__ encoding Dec 16, 2017
ruby_assert.h fix build with VM_CHECK_MODE > 0 Jan 25, 2016
ruby_atomic.h Revert r52995 Dec 9, 2015
rubystub.c rubystub.c: sys/param.h for MAXPATHLEN Aug 20, 2016
safe.c call `rb_vm_stack_to_heap()` Oct 29, 2017
signal.c remove `PUSH_TAG`/`EXEC_AG`/`POP_TAG`/`JUMO_TAG`. Dec 6, 2017
siphash.c switch SipHash from SipHash24 to SipHash13 variant Jan 20, 2017
siphash.h switch SipHash from SipHash24 to SipHash13 variant Jan 20, 2017
sparc.c configure.ac Sep 29, 2017
sprintf.c error.c: KeyError#receiver and KeyError#key Sep 18, 2017
st.c merge revision(s) 62396: [Backport #14357] Mar 20, 2018
strftime.c adjust styles [ci skip] May 10, 2017
string.c merge revision(s) 62892,62893: [Backport #14363] Mar 22, 2018
struct.c merge revision(s) 61616: [Backport #14314] Feb 16, 2018
symbol.c common conversion functions Oct 26, 2017
symbol.h Use HAVE_BUILTIN___BUILTIN_CONSTANT_P May 20, 2016
thread.c thread_sync: redo r62934 to use fork_gen Jul 24, 2018
thread_pthread.c move rb_thread_t::interrupt_flag and mask Nov 6, 2017
thread_pthread.h * thread_pthread.c (register_ubf_list): renamed from Nov 30, 2015
thread_sync.c thread_sync.c (condvar_ptr): reset fork_gen after forking Jul 24, 2018
thread_win32.c thread_win32.c: stop returning unused value Nov 16, 2017
thread_win32.h * ext/openssl/depend: remove dependency from internal headers. May 14, 2014
time.c extern rb_time_utc_offset to get utc offset Dec 11, 2017
timev.h configure.in, win32/Makefile.sub: PACKED_STRUCT with VC Feb 25, 2014
transcode.c * lib/net/http/header.rb: Fix typo. [ci skip][fix GH-1407] Aug 16, 2016
transcode_data.h transcode_data.h: missing cast Aug 8, 2015
util.c Drop to support NaCl platform. Oct 23, 2017
variable.c variable.c: fix thread + fork errors in autoload Jul 24, 2018
version.c version.c: no exit in ruby_show_copyright Jan 7, 2016
version.h merge revision(s) 63304: [Backport #14713] Jul 12, 2018
vm.c vm.c: always export rb_frame_method_id_and_class Dec 16, 2017
vm_args.c vm_args.c: ec arg of args_setup_kw_parameters Nov 21, 2017
vm_backtrace.c remove `PUSH_TAG`/`EXEC_AG`/`POP_TAG`/`JUMO_TAG`. Dec 6, 2017
vm_core.h variable.c: fix thread + fork errors in autoload Jul 24, 2018
vm_debug.h defines.h: RUBY_SYMBOL_EXPORT_{BEGIN,END} Apr 5, 2013
vm_dump.c vm_dump.c: [DOC] fix grammar Nov 7, 2017
vm_eval.c iseq.c: dump type of branchiftype on disasm Dec 13, 2017
vm_exec.c catch up recent changes for call threaded code VM. Oct 27, 2017
vm_exec.h vm_exec.h: introduce macros for abstarction. Dec 11, 2017
vm_insnhelper.c merge revision(s) 62394,62395: [Backport #14469] Mar 15, 2018
vm_insnhelper.h remove `trace` instruction. [Feature #14104] Nov 14, 2017
vm_method.c merge revision(s) 62725: [Backport #14604] Mar 20, 2018
vm_opts.h Remove "trace_instruction" compile option. Dec 24, 2017
vm_trace.c do not disable `trace_` prefix insns. Dec 11, 2017
vsnprintf.c unused member May 23, 2017

README.md

Build Status Build status

What's Ruby

Ruby is the interpreted scripting language for quick and easy object-oriented programming. It has many features to process text files and to do system management tasks (as in Perl). It is simple, straight-forward, 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://bugs.ruby-lang.org/projects/ruby-trunk/wiki/SupportedPlatforms

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/

The Ruby distribution files can be found on the following FTP site:

ftp://ftp.ruby-lang.org/pub/ruby/

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

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

Or if you are using git then use 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:

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

Or if you are using git then use the following command:

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

Ruby home page

The URL of the Ruby home page is:

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

Mailing list

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

subscribe

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

How to compile and install

This is what you need to do to compile and install Ruby:

  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).

Bug reports should be filed 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.

mailto:matz@ruby-lang.org