evanphx / rubinius

Rubinius, the Ruby VM

This URL has Read+Write access

rubinius / doc / getting_started.txt
100644 178 lines (102 sloc) 4.399 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# Quick Start
 
The following is a quick summary for building Rubinius. It assumes that you
already have required libraries installed. For a more complete guide, see the
next section.
 
1. Install [ruby 1.8](http://www.ruby-lang.org/en/downloads/)
1. Install [RubyGems](http://rubyforge.org/projects/rubygems)
1. Install rake and ParseTree: <tt>gem install rake ParseTree</tt>
1. Install Git
1. Clone rubinius: <tt>git clone git://github.com/evanphx/rubinius.git</tt>
1. cd to your rubinius checkout
1. `rake`
1. `bin/rbx -v`
 
 
# Getting Started
 
If you are having trouble getting or building Rubinius, the #rubinius IRC
channel on irc://irc.freenode.net can help. You can also ask on the [mailing
list](http://groups.google.com/group/rubinius-dev).
 
 
## Installing 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 4.x (both g++ and gcc)](http://gcc.gnu.org/)
* [GNU Bison](http://www.gnu.org/software/bison/)
* [Ruby version >= 1.8.4 (the Ruby language)](http://www.ruby-lang.org/)
* [RubyGems (Ruby package manager)](http://www.rubygems.org/)
* [Git (source control used by rubinius)](http://git.or.cz/)
* [zlib compression library](http://www.zlib.net/)
 
Most systems already use GNU Make as their default, but for those using a BSD
Make:
 
* [gmake (GNU Make)](http://savannah.gnu.org/projects/make/
 
Each package may have requirements of its own, of course.
 
If you want to avoid overriding your existing environment, you may want to
install 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
gmake 'gmake'). You can then adjust your PATH environment variable as needed
for rubinius development.
 
 
### Requirements through RubyGems
 
* rake
* ParseTree
 
Rake may be obtained with the <tt>gem install</tt> command. See <tt>gem
help</tt> and http://www.rubygems.org for more information.
 
### System-dependent requirements
 
 
#### FreeBSD, OpenBSD
 
* [libexecinfo](http://www.freshports.org/devel/libexecinfo)
 
 
#### Debian/Ubuntu family systems
 
For the build to succeed you will need these packages:
 
* ruby-dev (or ruby1.8-dev)
* libreadline5-dev
* zlib1g-dev
* libssl-dev
 
 
## Getting Rubinius
 
You need to clone the Rubinius source from the Github repository:
 
  git clone git://github.com/evanphx/rubinius.git
 
For more information on Rubinius' best practices for git, see
[Using Git](/using_git.html)
 
 
## Compiling Rubinius
 
The C++ VM is compiled using Rake. Typically, it will be as simple as:
 
    rake
      OR
    rake build
 
If you plan on doing development work, or otherwise need debug access,
use the +debug+ subtask:
 
    rake build:debug
 
 
## Running VM Tests
 
Build and run the tests:
 
  rake vm:test
 
To run only one test suite, use:
 
  rake vm:test[SomeClass]
 
If you want to run a single test suite under gdb, use:
 
  SUITE="SomeClass" gdb vm/test/runner
 
 
## Running the Specs
 
Rubinius includes a stable copy of the RubySpecs that is tagged so that a
clean set (i.e. passing 100%) of specs can be run as part of the continuous
integration (CI) process. To run the CI specs:
 
    rake spec
 
OR
 
    bin/mspec ci
 
To run the most current version of RubySpec:
 
    rake rubyspec:update
    bin/mspec spec/ruby
 
To run a particular spec file, for example, the Array specs:
 
    bin/mspec spec/ruby/1.8/core/array
 
 
## Installing Rubinius
 
Run the 'rake install' task to install Rubinius (you may need sudo). Run the
'rake uninstall' task to uninstall Rubinius.
 
 
## Running Rubinius
 
Once compiled, you can verify the VM works:
 
    bin/rbx -v
 
Rubinius generally works like Ruby from the command-line. For example:
 
    bin/rbx -e 'puts "Hello!"'
 
To run a ruby file named 'code.rb':
 
    bin/rbx code.rb
 
To use the interactive prompt (similar to Ruby's IRB):
 
    bin/rbx
 
## Rubinius Configuration
 
Rubinius provides a -X command line switch for manipulating the internal
configuration options. For example,
 
    -Xrbx.jit enables the jit if it's supported by the platform
    -Xrbx.dyni enables the dynamic interpreter if it's supported
 
 
## Troubleshooting
 
See [Common Problems](/common_problems.html) or ask questions in the #rubinius
IRC channel on irc.freenode.net.