Short walkthrough for installing Rubinius.
Trouble?
- Here: Common build problems and solutions
- IRC: #rubinius on irc://irc.freenode.net
- ML: http://groups.google.com/group/r...
Getting the software and required libraries
There are a few things that you need in order to be able to build and run Rubinius. Once you have installed the general requirements, install the Gems needed and then any platform-specific requirements.
General requirements
- GCC version 4.x
- GNU Bison
- gmake (GNU Make)
- pkg-config (configuration tool)
- libtool version >= 1.5
- Ruby version >= 1.8.4 (the Ruby language)
- RubyGems (Ruby package manager)
- Git (source control used by rubinius)
- zip and unzip commands (archiving)
Each package may have requirements of its own, of course.
If you want to avoid overriding your existing environment, you may want toinstall everything under its own prefix (such as /usr/local) and to name programs so they don't collide with your existing installation (such as naming GNU make as gmake instead). You can then adjust your PATH environment variable as needed for Rubinius development.
Requirements through RubyGems
- rake
Rake may be obtained with the gem install command. See gem help and http://www.rubygems.org for more information.
Rubinius
You should check Rubinius out through Git which we just installed. The invocation looks like this (note the git:// protocol if not copy-pasting):
$ git clone git://git.rubini.us/code rubinius
When you receive commit rights, the above changes to:
$ git clone git@git.rubini.us:code rubinius
This creates a new subdirectory rubinius/ containing the HEAD or most current version of Rubinius in your current path. If you are new to git or want to see the workflow used, see using git.
There are daily tarballs available but these are not stable: http://rubini.us/releases/daily/...
Getting the RubySpec submodules
You need to fetch the source for MSpec and the RubySpec submodules manually. After running 'git clone' above, run:
rake spec:update
The spec:update task is also a dependency of the git:update task. So, if you use the rake tasks for updating your Rubinius sources, the MSpec and RubySpec source will automatically be updated. If you use the git commands manually, you will need to run rake spec:update also.
Compiling Rubinius
Once you have all the prerequisites installed, building rubinius is as simple as:
$ cd /path/to/rubinius
$ rake build
This will give you a binary, ./shotgun/rubinius which can then be invoked to run scripts. If your system compiler is not GCC 4.x, you can set the CC environment variable:
$ CC=/path/to/gcc rake build
If you want a development version (no optimisations, extra debug info), definitely recommended for anyone planning to work with the C parts, set the DEV environment variable:
$ DEV=1 rake build
Installing Rubinius
To install rbx as a shortcut for @./bin/rbx@:
$ rake install
Troubleshooting and platform-specific notes
Missing Bison
The resulting errors of not having Bison installed can be confusing. This is because the compilation has problems in a later stage and it's easy to overlook the earlier warnings. If you're error comes down to a "missing grammar.c", you don't have Bison installed.
The following trace is a shorted example of how the error could look like:
...
DEP hash.c
DEP grammar_runtime.c
bison -o grammar.c grammar.y
make[2]: bison: Command not found
DEP float.c
DEP ffi_util.c
...
DEP array.c
DEP ar.c
make[2]: Leaving directory `/home/rubinius/src/rubinius/shotgun/lib'
make[2]: Entering directory `/home/rubinius/src/rubinius/shotgun/lib'
bison -o grammar.c grammar.y
make[2]: bison: Command not found
CC ar.o
CC array.o
...
CC grammar.o
cc: grammar.c: No such file or directory
cc: no input files
make[2]: *** [grammar.o] Error 1
make[2]: Leaving directory `/home/rubinius/src/rubinius/shotgun/lib'
make[1]: *** [lib/librubinius-0.8.0.so] Error 2
make[1]: Leaving directory `/home/rubinius/src/rubinius/shotgun'
make: *** [vm] Error 2
rake aborted!
Command failed with status (2): [make vm...]
/home/rubinius/src/rubinius/Rakefile:121
(See full trace by running task with --trace)
64-bit platforms
Currently mostly works on amd64 and Opteron. Other 64-bit platforms have not been tested.
Mac OS X with Fink
See http://42squared.com/posts/how_t...
If you are getting an error like this one:
glibtool: link: cannot build libtool library `librubinius.la' from non-libtool objects: ...
This is probably because you are using an old glibtool (1.3.5 or similar) that came with Fink. This is the case when `which glibtool` returns /sw/bin/glibtool. You want to use /usr/bin/glibtool (1.5) instead. If you are radical you can just `sudo rm /sw/bin/glibtool` to fix this mess.
Ubuntu
For the build to succeed you will need these packages:
- libglib2.0-dev
- zlib1g-dev
- build-essential
- libreadline5-dev
- libssl-dev
- bison
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
0.10—69% complete
Completed 9 of 13 tickets
Pages
- Home
- FAQ
- IRC Info and Who's Who
- Releases
- Using Git
- Installation
- Getting Started
- Common Build Problems and Solutions
- Howto - Contribute
- Howto - Write a ticket
- Howto - Run my Rails app with Rubinius
- Howto - Write a Ruby spec
- Howto - Write a Rubinius spec
- Howto - Fix a failing spec
- Howto - Develop with a separate RubySpec repo
- Howto - Debug shotgun
- The Rubinius specs
- Shotgun - The Rubinius Virtual Machine
- Developer Readme
- Core Library - Coding Guidelines
- Coding Style Guide
- Contributor Platforms
- Stuff to read
- Extending Standard Library Specs
- Improve Gem Support in Rubinius
- Actors - Concurrent Rubinius
- FFI or Foreign Function Interface
