Ruby packages for Ubuntu
Brightbox have been providing optimised Ruby packages for Ubuntu for years. We’re currently maintaining packages for Ruby 1.8.7, 1.9.3, 2.0 and 2.1.
Our repositories also include updated Passenger packages and NGINX packages.
We provide Ruby 1.8.7 packages for Ubuntu Lucid, Precise, Quantal, Raring and Saucy. Our Ruby 1.8.7 packages include some major performance improvements:
- Ruby Enterprise Edition patches for 1.8.7-358 (2012.02)
- Built with Google’s high performance memory allocator, tcmalloc
- Updated rubygems packages to latest 1.3.x release
We provide Ruby 1.9.3 packages for Ubuntu Lucid, Precise, Quantal, Raring and Saucy. Our Ruby 1.9.3 packages include some major performance improvements:
- Built Ruby 1.9.3 with Google’s high performance memory allocator, tcmalloc
- Added Sokolov Yura’s performance patches for 1.9.3
- Added Narihiro Nakamura’s Bitmap Marking garbage collector (backported by Sakolov Yura)
- Greg Price’s “require” performance fixes.
- Patched Ruby 1.9.3 to export the right symbols to work with ruby-debug
- Updated rubygems to latest 1.8.x release
We provide Ruby 2.0 packages for Ubuntu Lucid, Precise, Quantal, Raring and Saucy. Our Ruby 2.0 packages are stock upstream versions with no added performance patches.
We provide Ruby 2.1 packages for Ubuntu Precise, Quantal, Raring and Saucy. Our Ruby 2.1 packages are stock upstream versions with only one minor exception fixing a rubygems gem installation performance regression.
All the above packages are available right now in our Launchpad package repository. You can add the repository to your servers like this:
sudo apt-get install python-software-properties sudo apt-add-repository ppa:brightbox/ruby-ng sudo apt-get update
and you can install or upgrade ruby like this:
sudo apt-get install ruby rubygems ruby-switch
If you’re upgrading, some packages have been replaced so you will see apt removing some packages (such as rubygems1.8, irb1.8 and others) – don’t panic :)
To install Ruby 1.9.3:
sudo apt-get install ruby1.9.3
And you can run the different versions of ruby like this:
$ ruby1.8 -v ruby 1.8.7 (2012-02-08 MBARI 8/0x8770 on patchlevel 358) [i486-linux], MBARI 0x8770, Ruby Enterprise Edition 2012.02 $ ruby1.9.3 -v ruby 1.9.3p484 (2013-11-22) [x86_64-linux] Brightbox $ gem1.8 install bundler $ gem1.9.3 install bundler
Switching the default Ruby version
You can also switch the default Ruby version back and forth between versions using the
$ ruby -v ruby 1.8.7 (2012-02-08 MBARI 8/0x8770 on patchlevel 358) [i486-linux], MBARI 0x8770, Ruby Enterprise Edition 2012.02 $ ruby-switch --list ruby1.8 ruby1.9.1 ruby2.0 ruby2.1 $ sudo ruby-switch --set ruby1.9.1 update-alternatives: using /usr/bin/ruby1.9.1 to provide /usr/bin/ruby (ruby) in manual mode. update-alternatives: using /usr/bin/gem1.9.1 to provide /usr/bin/gem (gem) in manual mode. $ ruby -v ruby 1.9.3p484 (2013-11-22) [x86_64-linux] Brightbox
(note that Ruby 1.9.3 shows as 1.9.1, due to a historical Debian thing about binary compatibility)
The binaries installed by gems (such as bundler’s “bundle” command) might not automatically use the current default version of ruby (preferring the version that was default at the time it was installed). In that case, you can run it under a specific version like this:
$ ruby1.9.1 -S bundle -v Bundler version 1.1.3
Note that some older versions of Rails do not work with the latest versions of Rubygems - if you’re using our Rubygems 1.3.7 packages and don’t want to upgrade them, you can pin them like this:
cat <<EOF > /etc/apt/preferences.d/rubygems Package: rubygems Pin: version 1.3.* Pin-Priority: 600 Package: rubygems1.8 Pin: version 1.3.* Pin-Priority: 600 EOF
Our passenger packages have been updated to support switching between 1.8.7 and 1.9.3. By default it supports 1.8.7, and to add 1.9.3 support just install the package:
$ sudo apt-get install passenger-common1.9.1
Then you can safely switch the default ruby to 1.9.3, or tell Passenger to use it directly.
If you have any feedback or comments, or just want to follow along with the latest announcements, join the Google Groups list. All feedback is always welcome - we like to hear from you even if everything worked :)
We have a separate experimental repository that holds test builds.
We recommend only using this experimental repository for testing purposes. Use the main repository for stable updates.