Code Monkey home page Code Monkey logo

rvm-patchsets's Introduction

RVM Patchsets for MRI-Ruby

About

Over time, I have developed a number of patches to MRI ruby which I use in all my projects. I maintain them using stgit. This repository provides them as patchsets for RVM.

They are also frequently merged into the main rvm repository, so usually you can use them directly after installing/updating rvm.

Usage

Step 1

To use the a recent version of the patchsets, just update rvm:

rvm get head # OR
rvm get stable

If rvm isn’t update to date yet, or you can easily install them from this repository:

  • clone the repository to some convenient place

  • cd into the top level directory

  • run install.sh

This will automatically remove old versions of the patchsets.

Step 2

Reinstall the rubies you want to patch:

rvm reinstall 1.8.7 --patch railsexpress
rvm reinstall 1.9.2 --patch railsexpress
rvm reinstall 1.9.3 --patch railsexpress

Alternatively, you can pass the ruby version to reinstall to the install script:

./install.sh 1.8.7 1.9.2 1.9.3

IF you don’t want to mess up your vanilla rubies, pass a -n flag to rvm when installing the patches:

rvm reinstall 1.8.7 --patch railsexpress -n railsexpress
rvm reinstall 1.9.2 --patch railsexpress -n railsexpress
rvm reinstall 1.9.3 --patch railsexpress -n railsexpress

This will then require you to specify the ruby version for rvm like so:

rvm use 1.9.2-railsexpress

Notes

The patches are for specific versions of ruby. They might work with later versions, but there’s no guarantee. The following versions are currently supported:

1.8.7-p334  # not recommended, as p352 fixes a serious GC corruption problem
1.8.7-p352  # not recommended, use at least p358
1.8.7-p357  # fixes a DOS vulnerability in 1.8.7
1.8.7-p358  #
1.8.7-p370  #
1.8.7-p371  # current rvm default for MRI-ruby 1.8.7
1.9.2-p180  #
1.9.2-p290  #
1.9.2-p318  #
1.9.2-p320  # current rvm default for MRI-ruby 1.9.2
1.9.3-p125  # not recommended, use p448 or head
1.9.3-p194  # not recommended, use p448 or head
1.9.3-p286  # not recommended, use p448 or head
1.9.3-p327  # not recommended, use p448 or head
1.9.3-p362  # not recommended, use p448 or head
1.9.3-p374  # not recommended, use p448 or head
1.9.3-p385  # not recommended, use p448 or head
1.9.3-p448  # not recommended, use p448 or head
1.9.3-p429  # not recommended, use p448 or head
1.9.3-p448  # current rvm default for MRI-ruby 1.9.3

In order to make some patch level N the default for rvm, add the line(s)

ruby_1.8.7_patch_level=N
ruby_1.9.3_patch_level=N

to $rvm_path/user/db.

To enable heap dump support, pass the –enable-gcdebug option to the rvm install command.

rvm reinstall 1.8.7 --patch railsexpress -n gcdebug -C --enable-gcdebug
rvm reinstall 1.9.2 --patch railsexpress -n gcdebug -C --enable-gcdebug
rvm reinstall 1.9.3 --patch railsexpress -n gcdebug -C --enable-gcdebug

If rvm cannot configure your ruby, update your rvm install.

If you’re like me and prefer to manage the libraries needed for installing ruby yourself, for example using MacPorts or HomeBrew, then you need to tell the ruby compilation process where these libraries are:

rvm reinstall 1.9.3 --patch railsexpress -C --with-opt-dir=/opt/local

Installing on Mountain Lion

If you want to install versions earlier than 1.9.3, you must install gcc-4.2.

With MacPorts, this is as easy as

sudo port install apple-gcc42
sudo ln -s /opt/local/bin/gcc-apple-4.2 /usr/bin/gcc-4.2

Additionally, when compiling ruby, you need to set

CPPFLAGS=-I/opt/X11/include

Script install.sh will set CPPFLAGS automatically for you.

Using patches for ruby-branches (1.8.7/1.9.3 only)

The most recent patch level on the ruby_1_8_7 branch is 360. If you want to use it, you can install the corresponding ruby version with the following command:

rvm reinstall 1.8.7-head --patch railsexpress -n railsexpress

You can then use it with the command

rvm use 1.8.7-head-railsexpress

Note that the patch contained in patch level 359 fixes a serious bug in the ruby marshaling code, which can crash the ruby interpreter.

On 1.9.3, you can install head similarly:

rvm reinstall 1.9.3-head --patch railsexpress -n railsexpress

Patch Improvements

If you find problems with the patches, please do not send pull requests which patch patches. I will ignore these.

Instead, add new patches on top of the existing ones. Then they will have a chance.

Caveats

  • All patches are provided without any warranty. Use at your own risk!

Credits

Some of the patches are based on the work of others (some of them are included in ruby enterprise edition)

rvm-patchsets's People

Contributors

felixbuenemann avatar

Watchers

Fernando Morgenstern avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.