Skip to content
A concerted effort to augment and enhance Ruby MRI documentation
Ruby C HTML Yacc Makefile Emacs Lisp Other
Find file
#47 Compare This branch is 2625 commits behind ruby:trunk.
Latest commit 3dabe30 Sep 22, 2015 svn * 2015-09-23
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Failed to load latest commit information.
benchmark new benchmarks for hashing dsyms and fixnums Jul 29, 2015
bin * bin/erb: $SAFE=3 is obsolete. Jun 18, 2015
bootstraptest * bootstraptest/test_method.rb: remove a test because $SAFE=2 was Jun 18, 2015
ccan ccan/list/list.h: suppress unused argument warnings Sep 6, 2015
coverage fix a typo [ci skip] Sep 12, 2014
cygwin win32.c: fake lchown Aug 26, 2015
defs gmake.mk: no docs if test only Sep 2, 2015
doc [DOC] Remove `\0` since it's aprt of octal notation Sep 16, 2015
enc enc: fundamental encindex Sep 15, 2015
ext * ext/openssl/*: Remove svn commit id macros to make sync easier Sep 22, 2015
gems gems/bundled_gems: Upgrade the did_you_mean gem to 1.0.0.beta2 Sep 8, 2015
include ruby.h: RUBY_FL_PROMOTED Sep 16, 2015
lib * lib/net/ftp.rb (parse_mlsx_entry): parse pathnames including Sep 14, 2015
man man: updated May 23, 2015
misc Import ruby-electric.el version 2.2.3 from upstream Apr 24, 2015
missing missing/setproctitle.c: Avoid invalidating argv[1], argv[2], etc. unt… Oct 8, 2014
nacl Fix PNaCl configure/link errors. Oct 22, 2014
sample * sample/exyacc.rb: Fix some typos. Jun 12, 2015
spec * spec/default.mspec: use default configuration file name. Feb 25, 2015
template fake.rb: extmk mode Sep 4, 2015
test * test/drb/test_drb.rb: Run Rinda/DRb tests on localhost. [Fix GH-1027] Sep 21, 2015
tool * vm_core.h: split rb_call_info_t into several structs. Sep 19, 2015
win32 win32.c: fallback to WCHAR-version in MSVCRT Sep 22, 2015
.document * .document: removed needless entries. Mar 25, 2015
.editorconfig .editorconfig: new Sep 15, 2012
.gdbinit refix r51329 and show thread information Jul 29, 2015
.gitignore common.mk: fix conflict of version.i Jul 29, 2015
.indent.pro * .indent.pro: added for ruby-style. Mar 11, 2010
.travis.yml * .travis.yml: retry. Sep 9, 2015
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: change Ruby's License from a dual license with GPLv2 Sep 15, 2010
COPYING.ja Change encoding from EUC-JP to UTF-8. [Feature #5128] Sep 4, 2011
ChangeLog * ext/openssl/*: Remove svn commit id macros to make sync easier Sep 22, 2015
GPL * GPL: update text of GPLv2. [ruby-core:44488] [Bug #6328] Jun 3, 2012
KNOWNBUGS.rb * test/ruby/test_method.rb (test_unlinked_method_entry_in_method_obje… Mar 25, 2013
LEGAL LEGAL: adjust style Aug 17, 2015
Makefile.in Makefile.in: PIC lex.c Jul 22, 2015
NEWS file.c: File.mkfifo Sep 18, 2015
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 README.ja.md: fix markup miss. [ci skip] Jun 10, 2015
README.md * README.md: improve markdown rendering for readable. Sep 12, 2015
addr2line.c * addr2line.c (fill_lines): get base addrs in fill_lines to use it Apr 14, 2014
addr2line.h * addr2line.c (fill_lines): loop reverse order not to overwrite Mar 26, 2014
array.c array.c: [DOC] correct Array#sort rdoc [ci skip] Sep 15, 2015
bignum.c internal.h: roomof Jun 21, 2015
class.c * class.c (move_refined_method): should insert a write barrier Aug 31, 2015
common.mk common.mk: no prefixes Sep 18, 2015
compar.c compar.c: variable name [ci skip] Feb 21, 2015
compile.c * vm_core.h: split rb_call_info_t into several structs. Sep 19, 2015
complex.c ruby/missing.h: M_PI fallback definition Jul 21, 2015
configure.in file.c: File.mkfifo Sep 18, 2015
constant.h variable.c: Module#deprecate_constant Jul 30, 2015
cont.c cont.c: append to continuations doc [ci skip] Sep 20, 2015
debug.c ruby.h: add prefix Sep 13, 2015
dir.c * dir.c (glob_helper): check pathtype once again by lstat(2) if Sep 16, 2015
dln.c dln.c: fix EXTERNAL_PREFIX May 1, 2015
dln.h dln.c: extra arguments Jun 30, 2013
dln_find.c dln_find.c: define S_ISREG Jan 24, 2015
dmydln.c * encoding.c (rb_enc_codepoint_len): Use UNREACHABLE to avoid "control Apr 13, 2012
dmyenc.c load.c: tweak the return value Dec 3, 2014
dmyext.c dmyenc.c: separate Nov 27, 2014
encindex.h * encindex.h: fix typo of last #endif comment. Sep 16, 2015
encoding.c encindex.h: ENCINDEX Sep 15, 2015
enum.c * enum.c: added doc for Enumerable#zip Aug 11, 2015
enumerator.c * internal.h: use T_IMEMO to represent `struct MEMO' value. Mar 11, 2015
error.c error.c: remove singleton method Jun 25, 2015
eval.c improve handling of timer thread shutdown Aug 14, 2015
eval_error.c eval.c: check tag value Jul 19, 2015
eval_intern.h compile.c: use ruby_tag_type Jul 17, 2015
eval_jump.c eval.c: use the given thread Feb 24, 2015
file.c file.c: File.mkfifo Sep 18, 2015
gc.c gc.c: define objspace functions always Sep 15, 2015
gc.h gc.h: evaluate the macro argument only once Jul 14, 2015
gem_prelude.rb * ruby.c (usage, enable_option, disable_option, process_options): new Sep 9, 2015
golf_prelude.rb * golf_prelude.rb: syntax formatting for whitespace [Fixes GH-425] Nov 7, 2013
goruby.c goruby.c: suppress warning Aug 10, 2014
hash.c hash.c: [DOC] orders do not matter [ci skip] Sep 4, 2015
ia64.s * removed trailing spaces. Jun 9, 2012
id_table.c id_table.c: fix types Sep 17, 2015
id_table.h id_table.h: include guard Sep 17, 2015
inits.c * internal.h: Include ruby.h and ruby/encoding.h to be Nov 15, 2014
insns.def * vm_core.h: split rb_call_info_t into several structs. Sep 19, 2015
internal.h encindex.h: ENCINDEX Sep 15, 2015
io.c encindex.h: ENCINDEX Sep 15, 2015
iseq.c * iseq.c (rb_iseq_free): free rb_iseq_t::body::cc_entries. Sep 19, 2015
iseq.h * vm_core.h: split rb_call_info_t into several structs. Sep 19, 2015
lex.c.blt Makefile.in: PIC lex.c Jul 22, 2015
load.c load.c (features_index_add): avoid repeat calculation Aug 13, 2015
loadpath.c * loadpath.c (RUBY_REVISION): Defined to suppress revision.h Jun 17, 2013
localeinit.c localeinit.c: encindex.h Sep 15, 2015
main.c * include/ruby/debug.h: introdudced. Nov 20, 2012
marshal.c encindex.h: ENCINDEX Sep 15, 2015
math.c object.c: rb_num_to_dbl Aug 13, 2015
method.h iseq.h: rb_iseq_t Sep 19, 2015
miniinit.c encoding.c: find encoding index Aug 24, 2015
node.c gc.c: move tmp buffer functions Aug 6, 2015
node.h rb_parser_compile_*: remove volatile arg Aug 11, 2015
numeric.c * numeric.c (Init_Numeric): Fix document for Float::MIN and Aug 11, 2015
object.c object.c: rb_num_to_dbl Aug 13, 2015
pack.c * pack.c (pack_{un,}pack): new template character `j` and `J`, pointer Jun 12, 2015
parse.y parse.y: simplify ripper_id2sym Sep 19, 2015
prelude.rb * prelude.rb: [DOC] Update Thread::exclusive docs by @stevenharman. Apr 17, 2014
probes.d change lingering dtrace probe documentation from function- to method- May 30, 2015
probes_helper.h probes_helper.h (RUBY_DTRACE_HOOK): correct type for _id Feb 15, 2014
proc.c vm_method.c: reuse method entry Aug 19, 2015
process.c process.c: do not inherit saved fds Sep 12, 2015
random.c random.c: get rid of blocking Jul 25, 2015
range.c range.c: call range_include directly if possible Aug 15, 2015
rational.c rational.c: preserve encoding in exception Sep 11, 2015
re.c encindex.h: ENCINDEX Sep 15, 2015
regcomp.c * reg*.c: Merge Onigmo 5.15.0 38a870960aa7370051a3544 Sep 15, 2014
regenc.c oniguruma.h: constify Aug 27, 2015
regenc.h oniguruma.h: constify Aug 27, 2015
regerror.c * regcomp.c: Merge Onigmo 5.14.1 25a8a69fc05ae3b56a09. Jul 16, 2014
regexec.c uninitialized variable Dec 26, 2014
regint.h * Avoid undefined behaviors found by gcc -fsanitize=undefined. Oct 17, 2014
regparse.c regparse.c: remove unused variable Sep 16, 2014
regparse.h * reg*.c: Merge Onigmo 5.15.0 38a870960aa7370051a3544 Sep 15, 2014
regsyntax.c * Merge Onigmo-5.13.1. [ruby-dev:45057] [Feature #5820] Feb 17, 2012
ruby.c * ruby.c (usage, enable_option, disable_option, process_options): new Sep 9, 2015
ruby_atomic.h ruby_atomic.h: fix typo Sep 7, 2015
safe.c * safe.c: removed needless doc related $SAFE=2 Jun 18, 2015
signal.c revert r31760 and r31761 Jul 26, 2015
siphash.c UNALIGNED_WORD_ACCESS on ppc64 Jul 23, 2014
siphash.h * siphash.h: check configure macros before include newer headers. Nov 9, 2012
sparc.c * sparc.c: Use __asm__ instead of asm for gcc. Apr 27, 2013
sprintf.c sprintf.c: rb_inspect returns a string Jun 26, 2015
st.c st.c: constify st_table* in private functions Jul 29, 2015
strftime.c * strftime.c (rb_strftime_with_timespec): Test yday range. Apr 6, 2013
string.c string.c: separate resetting code range Sep 20, 2015
struct.c * make rb_iseq_t T_IMEMO object (type is imemo_iseq). Jul 21, 2015
symbol.c symbol.c: suppress warnings Aug 26, 2015
symbol.h * ext/objspace/objspace.c: add a new method ObjectSpace.count_symbols. Aug 21, 2015
thread.c thread.c: suppress warnings only if GCC6+ Sep 18, 2015
thread_pthread.c thread_pthread.c: async_bug_fd Sep 6, 2015
thread_pthread.h thread_pthread: prefer rb_nativethread* types/functions Aug 15, 2014
thread_sync.c thread_sync.c: fix typos Sep 3, 2015
thread_win32.c improve handling of timer thread shutdown Aug 14, 2015
thread_win32.h * ext/openssl/depend: remove dependency from internal headers. May 14, 2014
time.c * time.c (time_getlocaltime): [DOC] Add examples of valid utc_offset Jun 14, 2015
timev.h configure.in, win32/Makefile.sub: PACKED_STRUCT with VC Feb 25, 2014
transcode.c transcode.c: GC guards Aug 5, 2015
transcode_data.h transcode_data.h: missing cast Aug 8, 2015
util.c util.c: BSD qsort_r Sep 15, 2015
variable.c variable.c: fail if frozen Sep 16, 2015
version.c fake.rb.in: scan version.c Jun 11, 2015
version.h * 2015-09-23 Sep 22, 2015
vm.c * vm_core.h: split rb_call_info_t into several structs. Sep 19, 2015
vm_args.c * vm_core.h: split rb_call_info_t into several structs. Sep 19, 2015
vm_backtrace.c * make rb_iseq_t T_IMEMO object (type is imemo_iseq). Jul 21, 2015
vm_core.h * vm_core.h: split rb_call_info_t into several structs. Sep 19, 2015
vm_debug.h defines.h: RUBY_SYMBOL_EXPORT_{BEGIN,END} Apr 5, 2013
vm_dump.c * make rb_iseq_t T_IMEMO object (type is imemo_iseq). Jul 21, 2015
vm_eval.c * vm_core.h: split rb_call_info_t into several structs. Sep 19, 2015
vm_exec.c * vm_core.h: constify rb_iseq_constant_body::iseq_encoded and Jul 23, 2015
vm_exec.h * vm_exec.h (VM_DEBUG_STACKOVERFLOW): added. Dec 18, 2013
vm_insnhelper.c * vm_core.h: split rb_call_info_t into several structs. Sep 19, 2015
vm_insnhelper.h * vm_core.h: split rb_call_info_t into several structs. Sep 19, 2015
vm_method.c vm_eval.c: cache results Aug 22, 2015
vm_opts.h * vm_opts.h, iseq.c, iseq.h: add compile option to force frozen Aug 21, 2015
vm_trace.c * include/ruby/ruby.h, cont.c, vm_trace.c: add a new event Aug 21, 2015
vsnprintf.c sprintf.c: ruby specific functions Feb 22, 2015

README.md

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, Mac OS X, BeOS, etc.) cf. http://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:

http://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 http://svn.ruby-lang.org/repos/ruby/trunk/ ruby

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

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

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

$ svn ls http://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:

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

Mailing list

There is a mailing list to talk about Ruby. To subscribe 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

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.in, 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.

  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. Run 'make install'

    This command will create following directories and install files onto 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 (http://www.ruby-lang.org/en/community/mailing-lists) or on websites like (http://stackoverflow.com).

Bug reports should be filed at http://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

Something went wrong with that request. Please try again.