Getting Started
This guide will help you get Rubinius running. It assumes you know something about Ruby and about installing software on your system.
If you have trouble following the directions here, visit the #rubinius IRC channel on irc.freenode.net for help.
Requirements
Ensure you have the following programs and libraries installed. Also see the subsections below for special requirements for your particular operating system.
The following are suggestions for getting more information about the programs and libraries needed to build Rubinius. Your operating system or package manager may have other packages available.
- GCC and G++ 4.x
- GNU Bison
- MRI Ruby 1.8.7+ If your system does not have Ruby 1.8.7 installed, consider using RVM to install it.
- Rubygems
- Git
- ZLib
- pthread - The pthread library should be installed by your operating system
- gmake
- rake
[sudo] gem install rake
Apple OS X
The easiest way to get a build environment on Apple OS X is to install the XCode Tools and Utilities. Once installed, you can enable developer mode crash reporting at: /Developer/Applications/Utilities/CrashReporterPrefs.app
Debian/Ubuntu
- ruby-dev or ruby1.8-dev
- libreadline5-dev
- zlib1g-dev
- libssl-dev
Building Rubinius
You can build and run Rubinius from the source directory. You do not need to install Rubinius to run it. The directions below will detail both installing Rubinius and running it from the source directory.
Rubinius uses LLVM for the JIT compiler. Rubinius depends on a particular version of LLVM. If you have installed LLVM on your system, pass the ‘–skip-system’ flag to the configure script in the directions below.
The Rubinius source code is on Github: git://github.com/evanphx/rubinius.git
Installing Rubinius
./configure --prefix=/path/to/install/dir
rake install
Add /path/to/install/dir/bin to your PATH
Running from the Source Directory
If you plan to work on Rubinius itself, this is the simplest option.
./configure
rake
Add /path/to/source/dir/bin to your PATH
Running Rubinius
Once you have followed the steps for building (and possibly installing) Rubinius, you can verify it is working:
rbx -v
Rubinius generally works like Ruby from the command-line. For example:
rbx -e 'puts "Hello!"'
To run a ruby file named ‘code.rb’:
rbx code.rb
To run IRB:
rbx
Troubleshooting
See common problems and visit us in the #rubinius IRC channel on irc.freenode.net.