the Ruby programming language, unofficial mirror (see the wiki for details)
Ruby C Yacc Makefile Emacs Lisp C++ Other
Switch branches/tags
Pull request Compare This branch is 63 commits behind ruby:trunk.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
basictest
benchmark
bin
bootstraptest
ccan
coverage
cygwin MFLAGS for nmake Feb 10, 2017
defs vcs.rb: commit Jul 26, 2017
doc
enc
ext stringio.c: suppress a warning [ci skip] Aug 13, 2017
gems
include
lib
man * man/ruby.1: Move paragraph which is related to -S, not -s. Aug 4, 2017
misc Import ruby-electric.el version 2.3.1 from upstream Aug 10, 2017
missing string.c: for small crypt_data May 24, 2017
nacl Fix PNaCl configure/link errors. Oct 22, 2014
sample
spec
template
test
tool
win32 fix typo in help [ci skip] Aug 3, 2017
.document
.editorconfig Add config for *.yml [ci skip] Oct 30, 2016
.gdbinit
.gitattributes
.gitignore Use lcov visualizer for gcov statistics Jul 4, 2017
.indent.pro
.travis.yml
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.ja
GPL
KNOWNBUGS.rb gc.c: expand sorted pages Jun 22, 2017
LEGAL
Makefile.in
NEWS
README.EXT
README.EXT.ja README.EXT.ja: add redirect [ruby-core:68631] Mar 30, 2015
README.ja.md
README.md Fix heading of README. Apr 18, 2017
acinclude.m4 acinclude.m4: rename Jan 3, 2016
aclocal.m4
addr2line.c
addr2line.h
appveyor.yml
array.c
bignum.c
class.c remove unused rb_obj_basic_to_s_p function Jun 29, 2017
common.mk enum.c: make constant argument static Aug 11, 2017
compar.c
compile.c
complex.c complex.c: remove deprecated functions Feb 21, 2017
configure.in
constant.h use id_table for constant tables Dec 29, 2015
cont.c
debug.c debug.c: add FMODE constants Jul 5, 2017
debug_counter.c
debug_counter.h
dir.c
dln.c
dln.h
dln_find.c dln_find.c: MAXPATHLEN is not used already Jun 2, 2016
dmydln.c
dmyenc.c
dmyext.c dmyenc.c: separate Nov 27, 2014
encindex.h revert r52336 (commit miss) Oct 29, 2015
encoding.c
enum.c enum.c: make constant argument static Aug 11, 2017
enumerator.c
error.c
eval.c
eval_error.c
eval_intern.h UNALIGNED_MEMBER_ACCESS only for clang Jul 30, 2017
eval_jump.c move fields to ec. Jun 28, 2017
file.c
gc.c disable r59314 on mswin Jul 12, 2017
gc.h thread.c: during GC for thread Apr 12, 2017
gem_prelude.rb Reduce system calls by activating the `did_you_mean` gem. Feb 25, 2016
golf_prelude.rb * golf_prelude.rb: syntax formatting for whitespace [Fixes GH-425] Nov 7, 2013
goruby.c
hash.c
ia64.s
id_table.c adjust styles [ci skip] May 10, 2017
id_table.h id_table.h: dummy sentinel Aug 6, 2016
inits.c
insns.def move fields to ec. Jun 28, 2017
internal.h
io.c
iseq.c
iseq.h
lex.c.blt parse.y: symbol literals for alias/undef Mar 16, 2016
load.c
loadpath.c * loadpath.c (RUBY_REVISION): Defined to suppress revision.h Jun 17, 2013
localeinit.c
main.c
marshal.c
math.c
method.h
miniinit.c
node.c separate hash literal and keyword arguments Aug 11, 2017
node.h parse.y: should not warn op method call Jun 23, 2017
numeric.c
object.c
pack.c
parse.y
prelude.rb Revert r57690 except for read_nonblock Feb 23, 2017
probes.d
probes_helper.h
proc.c
process.c process.c: null bytes Jul 14, 2017
random.c
range.c
rational.c Improve performance of implicit type conversion May 31, 2017
re.c
regcomp.c Merge Onigmo 6.1.1 Feb 11, 2017
regenc.c Merge Onigmo 6.1.1 Feb 11, 2017
regenc.h
regerror.c get rid of strcat Dec 26, 2016
regexec.c
regint.h Merge Onigmo 6.1.1 Feb 11, 2017
regparse.c
regparse.h
regsyntax.c
ruby-runner.c
ruby.c
ruby_assert.h
ruby_atomic.h
rubystub.c rubystub.c: sys/param.h for MAXPATHLEN Aug 20, 2016
safe.c
signal.c vm_core.h: shrink trap_list size Jul 27, 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
sprintf.c
st.c st.c: adjust style Jul 19, 2017
strftime.c
string.c
struct.c
symbol.c symbol.c (rb_id2str): eliminate branch to set class Feb 3, 2017
symbol.h
thread.c
thread_pthread.c
thread_pthread.h * thread_pthread.c (register_ubf_list): renamed from Nov 30, 2015
thread_sync.c
thread_win32.c
thread_win32.h
time.c
timev.h
transcode.c
transcode_data.h transcode_data.h: missing cast Aug 8, 2015
util.c
variable.c variable.c (autoload_sleep_done): avoid needless list_node init May 22, 2017
version.c
version.h
vm.c rename rb_execution_context_t::stack(_size) to vm_stack(_size). Aug 10, 2017
vm_args.c
vm_backtrace.c introduce rb_thread_ptr() to replace GetThreadPtr(). Jun 28, 2017
vm_core.h vm_core.h: unreachable VM_UNREACHABLE Aug 10, 2017
vm_debug.h
vm_dump.c
vm_eval.c vm_eval.c: rb_lambda_call Jul 18, 2017
vm_exec.c
vm_exec.h
vm_insnhelper.c
vm_insnhelper.h
vm_method.c
vm_opts.h
vm_trace.c
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, Mac OS X, 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 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 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.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.

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