Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
GemStone Maglev Ruby Repository
Ruby Other
tag: MagLev-22549

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
Licenses
benchmark @ d807eea
bin
docs
etc
examples
gci
lib/ruby
rakelib
spec
src
tools
.gitignore
.gitmodules
LICENSES.txt
README.rdoc
Rakefile
THANKS
debug.mspec
default.mspec
passing.mspec

README.rdoc

License

Please see LICENSES.txt in this directory.

Prerequisites

Some prerequisites must be installed on your machine before MagLev can run correctly. For details, see the Prerequisites file in the docs directory.

A MagLev build requires a compatible version of the GemStone 3.x binaries. Use the installer mentioned below to ensure your MagLev and GemStone versions are in sync. Simply cloning this repository could result in an indeterminate state that won't run with any GemStone build.

Documentation

To generate the HTML version of this and other documentation:

cd to the directory holding this README

$ rake rdoc

open html/index.html in your web browser of choice

Quick Start

Install MagLev

Once you've downloaded MagLev by running installMaglev.sh or upgradeMaglev.sh, set your MAGLEV_HOME and PATH variables:

export MAGLEV_HOME=<path_to_the_directory_containing_this_README>
export PATH=$MAGLEV_HOME/bin:$PATH

It can also be useful to put any frequently used MagLev options (like “-d” or “-MtraceLoad”) in the environment variable MAGLEV_OPTS so you don't have to type them on the command line, and executables like rackup, rake, etc. can use them without modifying those scripts.

export MAGLEV_OPTS="-d -MtraceLoad"

run “maglev-ruby –help” to see possible options.

Start the MagLev server

The server is started with rake:

$ cd $MAGLEV_HOME
$ rake maglev:start

Check status of MagLev server

To check that the MagLev Server started correctly, run rake maglev:status, or simply, rake:

$ cd $MAGLEV_HOME
$ rake maglev:status

If the server is not running, you'll see output like:

(in /congo1/users/monty/MagLev/MagLev-22152.Linux)
maglev not running

If a server is running, you'll see output like:

(in /congo1/users/monty/MagLev/MagLev-22152.Linux)
Status  Version    Owner    Pid   Port   Started     Type  Name
------ --------- --------- ----- ----- ------------ ------ ----
  OK   3.0.0     monty     26354 33413 Aug 19 11:32 Stone  maglev

maglev-ruby: Execute a Ruby file

You should now be able to run a simple ruby script:

$ cat > hello.rb
puts "Hello from MagLev"
^D
$ maglev-ruby hello.rb
Hello from MagLev
$

maglev-irb: Open an interactive maglev shell

MagLev now includes a slightly modified copy of irb called maglev-irb. References in this documentation to maglev-irb currently apply to a deprecated maglev-irb version. We'll update the docs soon.

MagLev provides an IRB-like utility, $MAGLEV_HOME/bin/maglev-irb. It provides a minimal interactive environment with some limitations:

$ maglev-irb
>> 1 + 1
=> 2
*> puts "Hi"
Hi
=> nil
*> ^D
$

See maglev-irb for details.

Next Steps

Examples

You can try running the scripts in the examples directory.

Webrick

A simple example that starts a webrick server which you can connect to at localhost:2000/. To run the script, make sure maglev-ruby is on your path, and then:

$ $MAGLEV_HOME/examples/webrick/time_server.rb

^C will terminate the webrick server VM.

Further reading

The following documentation explains more:

Release Notes

Notes on and limitations of the current release.

Server

How to start and stop the MagLev server.

Debug

How to run MagLev in debug mode

Layout

Guide to the MagLev distribution file layout

Specs

Running mspec and rubyspecs with MagLev

Rake

Rake tasks for MagLev

maglev-irb

MagLev interactive utility

Troubleshooting

Solutions for common problems

Prerequisites

External software needed by MagLev

Persistence API

Persistence and transactions

Smalltalk FFI

GemStone Smalltalk FFI

MySQL Driver

MySQL driver

Benchmarks

Ruby Benchmark Suite benchmarks

Applications

Sample Ruby apps we're testing in MagLev

Hints:

  • set MAGLEV_HOME to the full path of this directory, and add $MAGLEV_HOME/bin to your PATH. Then you can use maglev-ruby etc. from anywhere.

Ruby code:

  • src/ and src/lib/ are both on the require path

  • src/kernel/ has the core Array, String etc. files

Something went wrong with that request. Please try again.