Skip to content

Instantly share code, notes, and snippets.

@Koronen
Created April 12, 2014 18:53
Show Gist options
  • Save Koronen/10550810 to your computer and use it in GitHub Desktop.
Save Koronen/10550810 to your computer and use it in GitHub Desktop.
Cross-compile Ruby 2.1.0 for Raspberry Pi (WIP)
#!/bin/bash
set -e
# Enable multiverse repo
sudo sed -i "59,60s/^# //g" /etc/apt/sources.list
sudo apt-get update
# Install dependencies
sudo apt-get install -y git build-essential gcc-arm-linux-gnueabihf
sudo apt-get build-dep -y ruby1.9.1
# Install ruby-build
[ -d ruby-build ] || git clone https://github.com/sstephenson/ruby-build.git
# Cross-compile Ruby
export RUBY_BUILD_BUILD_PATH=/tmp/ruby-build
export CC=arm-linux-gnueabihf-gcc
export CONFIGURE_OPTS="--host x86_64-linux-gnu --build arm-linux-gnueabihf --disable-install-rdoc --disable-install-ri"
export RUBY_CONFIGURE_OPTS="--without-ripper"
ruby-build/bin/ruby-build --verbose --keep 2.1.0 ruby-2.1.0-armhf
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "precise-server-amd64"
config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment