Skip to content

Instantly share code, notes, and snippets.

@hone
Last active December 18, 2015 04:19
Show Gist options
  • Save hone/417819ea3bf1bfea2333 to your computer and use it in GitHub Desktop.
Save hone/417819ea3bf1bfea2333 to your computer and use it in GitHub Desktop.

I was looking into what it would take to support .ruby-version on heroku. I was looking for a spec but couldn't find one. I saw the gisted doc but I couldn't see the format being described. But it looks like it's just:

<engine>-<engine_version>

The problem is that I want to specify the ruby version for something like JRuby. The differences of 1.8 or 1.9 mode in JRuby are significant. The way I store the files on Heroku is something like this:

ruby-<ruby_version>-<engine>-<engine_version>

The versions for each would include major, minor, and patch where appropriate. This is something we strived to achieve in Bundler. A path I also see forward with Bundler is that bundle install will "lock" the version to a .ruby-version file that's generated and people can check this in. Heroku can then read this file to determine the ruby version. The other benefit is Bundler can also still perform runtime checks to make sure you're running the right ruby version.

@sferik
Copy link

sferik commented Jul 22, 2013

I assume this is the gist you are referring to?

If you want to change the format, it needs to be backward compatible with the existing format. Something that allows for greater precision sounds good to me but rbenv, chruby, and rvm will need to be patched to parse the new format, so it’s probably best to involve the maintainers of those projects early.

Would this replace Bundler’s ruby method?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment