Ruby packages for Ubuntu
Brightbox have been providing optimised Ruby packages for Ubuntu for years. We’re currently maintaining packages for Ruby 2.7, 2.6, 2.5, 2.4, 2.3, 2.2, 2.1, 2.0, 1.9.3, and 1.8.7. Our Ruby 1.9.3 and 1.8.7 packages are modified with various performance improvements.
Ruby 2.7
We maintain Ruby 2.7 packages for Ubuntu Focal, Bionic and Xenial.
Ruby 2.6
We maintain Ruby 2.6 packages for Ubuntu Focal, Bionic and Xenial.
Ruby 2.5
We maintain Ruby 2.5 packages for Ubuntu Focal, Bionic and Xenial.
Ruby 2.4
We maintain Ruby 2.4 packages for Ubuntu Focal, Bionic and Xenial.
Ruby 2.3
We maintain Ruby 2.3 packages for Ubuntu Bionic and Xenial.
Ruby 2.2
We maintain Ruby 2.2 packages for Ubuntu Xenial. They include security fixes backported by us.
Ruby 2.1
We maintain Ruby 2.1 packages for Ubuntu Xenial. They include security fixes backported by us.
Ruby 2.0
We maintain Ruby 2.0 packages for Ubuntu Xenial. They include security fixes backported by us.
Ruby 1.9.3
We maintain Ruby 1.9.3 packages for Ubuntu Xenial. Our Ruby 1.9.3 packages include security fixes backported by us and some major performance improvements:
- Built with Google’s high performance memory allocator, tcmalloc
- Added Sokolov Yura’s performance patches
- Added Narihiro Nakamura’s Bitmap Marking garbage collector (backported by Sakolov Yura)
- Greg Price’s “require” performance fixes.
- Patched to export the right symbols to work with ruby-debug
- Updated rubygems to latest 1.8.x release
Ruby 1.8.7
We maintain Ruby 1.8.7 packages for Ubuntu Xenial. Our Ruby 1.8.7 packages include security fixes backported by us and other improvements:
- Built with Google’s high performance memory allocator, tcmalloc
- Updated rubygems packages to latest 1.8.x release
- Backported security fixes
Installation
All the above packages are available from our Launchpad package repository.
Adding the repository
$ sudo apt-get install software-properties-common
$ sudo apt-add-repository ppa:brightbox/ruby-ng
$ sudo apt-get update
Installing the packages
Each version of Ruby has its own packages - just install the packages for the versions you’d like to use.
So to install Ruby1.8, Ruby 1.9.3 and Ruby 2.2
$ sudo apt-get install ruby1.8 ruby1.9.3 ruby2.2
And you’ll usually need the dev
packages too, so you can build native extensions
$ sudo apt-get install ruby1.8-dev ruby1.9.3-dev ruby2.2-dev
Then you can run the different versions of ruby like this:
$ ruby1.8 -v
ruby 1.8.7 (2017-12-15 patchlevel 377) [x86_64-linux]
$ ruby1.9.3 -v
ruby 1.9.3p556 (2017-12-15) [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-switch
tool:
$ sudo apt-get install ruby-switch
$ ruby -v
ruby 1.8.7 (2017-12-15 patchlevel 377) [x86_64-linux]
$ ruby-switch --list
ruby1.8
ruby1.9.1
ruby2.0
ruby2.1
ruby2.2
ruby2.3
ruby2.4
ruby2.5
ruby2.6
ruby2.7
$ 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.3p556 (2017-12-15) [x86_64-linux] Brightbox
(note that Ruby 1.9.3 shows as 1.9.1, due to a historical Debian thing about binary compatibility)
Gem binaries
Any 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 explicitly run it under a specific version like this:
$ ruby1.9.1 -S bundle -v
Bundler version 1.6.3
If you’re using multiple versions of Ruby on a server, it’s best to explicitly run any ruby binaries with the desired version of Ruby like this.
Since Ruby 2.6, bundler is now distributed in the same packages, so are also versioned:
$ bundle2.6 -v
Bundler version 1.17.2
Mailing List
If you need any help, have any feedback or just want to follow along with the latest announcements, join the Google Groups list. All feedback is always welcome and we like to hear from you even if everything worked ok.
Experimental repository
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.
Support
If you’re not a paying customer, you can get free support from the mailing list. If you’d like to become a paying customer you can signup here for our cloud service. If you’d like paid support specifically for Ruby, or our Ruby Packages, contact us at hello@brightbox.com.
If you don’t need paid support and just want to support our work, we’ve got a Patreon page you can use: https://www.patreon.com/brightbox