by intrepion

GitHub Readme.md


Build Status


  • Cached rustup.sh, the Rust toolchain installer.
  • Configurable Rust version selection inside of the Cargo.toml, or by specifying the $RUST_VERSION environment variable.


We currently (ab)use the cargo's "target" feature to set the version desired. Unfortunately because of this there are sometimes (harmless) cargo warnings about an unused value in the toml file.



heroku create --buildpack https://github.com/intrepion/heroku-buildpack-rust

Example App

Make a Procfile file:

web: target/release/intrepion-heroku-rust-iron

Make a Cargo.toml file:

name = "intrepion-heroku-rust-iron"
version = "0.1.0"
authors = ["Oliver Forral <intrepion@gmail.com>"]

iron = "*"

In src/main.rs let's use a simple iron demo:

extern crate iron;

use iron::prelude::*;
use iron::status;
use std::env;

fn main() {
    fn hello_world(_: &mut Request) -> IronResult<Response> {
        Ok(Response::with((status::Ok, "Hello World!")))

    let url = format!("{}", env::var("PORT").unwrap());

    println!("Binding on {:?}", url);
    println!("Bound on {:?}", url);

Now the following steps:

git add src/main.rs Cargo.toml && \
git commit -m "Init" && \
git push heroku master

Heroku should then build your application. Finally, you may need to start your application's web dyno with:

heroku ps:scale web=1

Now you can visit the url given in the output and see your application!


If you have Docker, you can test this buildpack by doing the following:


The Makefile defines how to pull down the testrunner and build the appropriate docker container, then test the buildpack.