{"action":"created","issue":{"url":"https://api.github.com/repos/emk/heroku-buildpack-rust/issues/9","repository_url":"https://api.github.com/repos/emk/heroku-buildpack-rust","labels_url":"https://api.github.com/repos/emk/heroku-buildpack-rust/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/emk/heroku-buildpack-rust/issues/9/comments","events_url":"https://api.github.com/repos/emk/heroku-buildpack-rust/issues/9/events","html_url":"https://github.com/emk/heroku-buildpack-rust/issues/9","id":158582611,"number":9,"title":"Ruby application with Rust dependencies","user":{"login":"elifoster","id":4176124,"avatar_url":"https://avatars.githubusercontent.com/u/4176124?v=3","gravatar_id":"","url":"https://api.github.com/users/elifoster","html_url":"https://github.com/elifoster","followers_url":"https://api.github.com/users/elifoster/followers","following_url":"https://api.github.com/users/elifoster/following{/other_user}","gists_url":"https://api.github.com/users/elifoster/gists{/gist_id}","starred_url":"https://api.github.com/users/elifoster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elifoster/subscriptions","organizations_url":"https://api.github.com/users/elifoster/orgs","repos_url":"https://api.github.com/users/elifoster/repos","events_url":"https://api.github.com/users/elifoster/events{/privacy}","received_events_url":"https://api.github.com/users/elifoster/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-06-06T00:10:34Z","updated_at":"2016-09-22T14:42:27Z","closed_at":null,"body":"I've got a gem, string-utility, which is written in Rust using ruru for a few of its methods. I am trying to use this buildpack to install Rust and Cargo (without running `cargo build`, I can just fork the project and remove that tiny amount of code since it's a pretty uncommon desire at this point I'd imagine). However, it seems, even if the Rust buildpack runs successfully, Bundler is unable to find `cargo` or `rustc` to compile string-utility's Rust code. There was a similar question #6, except that question was regarding a project that was written with Node and Rust, not Node with Rust dependencies. In other words, it actually wanted to compile Rust code, then run Node separately. I've been trying to figure this out through experimentation and talking with Heroku support, and I've been unsuccessful for about 3 weeks. The majority of my projects depend on this library, and chances are, once I figure this out, many of my other libraries are going to be rewritten partially in Rust.\r\n\r\nI'm not really sure how to briefly ask what I'm trying to ask here. I suppose:\r\n* Is using this buildpack the correct way to get Rust/Cargo installed on a Heroku project?\r\n* If so, how can I get it to install such that Bundler can actually find it, or is that a bug in the buildpack?\r\n\r\nMy buildpack order: 1. emk/heroku-buildpack-rust, 2. heroku/ruby"},"comment":{"url":"https://api.github.com/repos/emk/heroku-buildpack-rust/issues/comments/248924062","html_url":"https://github.com/emk/heroku-buildpack-rust/issues/9#issuecomment-248924062","issue_url":"https://api.github.com/repos/emk/heroku-buildpack-rust/issues/9","id":248924062,"user":{"login":"schneems","id":59744,"avatar_url":"https://avatars.githubusercontent.com/u/59744?v=3","gravatar_id":"","url":"https://api.github.com/users/schneems","html_url":"https://github.com/schneems","followers_url":"https://api.github.com/users/schneems/followers","following_url":"https://api.github.com/users/schneems/following{/other_user}","gists_url":"https://api.github.com/users/schneems/gists{/gist_id}","starred_url":"https://api.github.com/users/schneems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schneems/subscriptions","organizations_url":"https://api.github.com/users/schneems/orgs","repos_url":"https://api.github.com/users/schneems/repos","events_url":"https://api.github.com/users/schneems/events{/privacy}","received_events_url":"https://api.github.com/users/schneems/received_events","type":"User","site_admin":false},"created_at":"2016-09-22T14:42:27Z","updated_at":"2016-09-22T14:42:27Z","body":"My bash is pretty rusty. Here's the gist of what you need to do, but it my not be perfect:\r\n\r\n```\r\n# Find directory of `bin` where `bin/compile` is located\r\nbin_dir=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\"\r\n\r\n# Find directory that buildpack is in, up one level from `bin`\r\n# then create an `export` file\r\nexport_file=\"$bin_dir/../export\"\r\ntouch $export_file\r\n\r\n# Now here is where you would add anything to the environment that is needed for Rust to run\r\n\r\n# Set CARGO_HOME for next buildpack\r\necho \"export CARGO_HOME=\"$CARGO_HOME\"\" >> $export_file\r\n\r\n# Set CARGO_TARGET_DIR for next buildpack\r\necho \"export CARGO_TARGET_DIR=\"$CARGO_TARGET_DIR\"\" >> $export_file\r\n\r\n# Prepend PATH so this Rust is guaranteed to come first\r\necho \"export PATH=\"$PATH:\\$PATH\"\" >> $export_file\r\n```\r\n\r\nThen when multiple buildpacks this `export` file will be sourced and then the next buildpack can find all those environment variables, as well as see that Rust is on the path.\r\n"}}
{"actor":{"display_login":"schneems"}}