Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

please add .ruby-version support #199

Closed
mpapis opened this issue Feb 29, 2012 · 17 comments
Closed

please add .ruby-version support #199

mpapis opened this issue Feb 29, 2012 · 17 comments
Labels
Milestone

Comments

@mpapis
Copy link

mpapis commented Feb 29, 2012

Hi,

@fnichol come with very nice idea to support one project file that could be used by all the ruby managers/switchers.

rbfu and RVM already support it, could you add it to rbenv too ?

Thanks,
Michal

@fnichol
Copy link

fnichol commented Mar 2, 2012

I'm more than happy to write up a pull request or a candidate implementation. Best case is it's about an additional 3-4 lines code code. I'm mostly curious if this is an idea with merit or if I've missed the boat. Thanks as always!

@tpope
Copy link
Contributor

tpope commented Mar 3, 2012

+1. Providing a tool-agnostic way to specify the version would help reduce the choice of tool from a holy war to a personal preference.

@ghost
Copy link

ghost commented Mar 3, 2012

This is definitely of merit. If we all work together for a bit of unification and forget the bravado, pissing contests, and holy wars we might actually be able to help the ruby community!

@fesplugas
Copy link

@michaelklishin
Copy link

This is a very good idea.

@stjernstrom
Copy link

+1

Maybe the easiest way is just to drop support for .rbenv-version and use .ruby-version instead?

@pusewicz
Copy link

pusewicz commented Mar 8, 2012

+1

@hmans
Copy link

hmans commented Mar 8, 2012

Definitely 👍 for .ruby-version. No opinion on dropping support for .rbenv-version (or .rbfu-version), really. Removing support for those files would probably surprise a lot of people. :)

@mpapis
Copy link
Author

mpapis commented Mar 26, 2012

any progress on merging #201 ?

@rmm5t
Copy link

rmm5t commented May 9, 2012

Bundler 1.2 is going to support a ruby version declaration in your Gemfile. Heroku is already supporting it.

@fnichol
Copy link

fnichol commented May 9, 2012

The bundler support is going to be great on Heroku and possibly good with RVM but I don't see how that attribute can be used out-of-the-box with rbenv. The build pack calls bundle platform --path to get the resulting string, but that string will not support the patch level. Unless you install your own Ruby builds under versions/, use symlinks, or create your own ruby-build definitions rbenv isn't going to know what version you want.

I'd imagine that in a Gemfile you could get away with:

ruby IO.read('.ruby-version').chomp.sub(/-p.*$/, '')

Having said all that, I'm happy to help 😄

@rmm5t
Copy link

rmm5t commented May 10, 2012

@fnichol Good idea on having the Gemfile read the .ruby-version or .rbenv-version file. That works well even on Heroku. I went with something like this to ensure that the file can be found no matter where bundler is executed from:

def ruby_version(file = ".rbenv-version")
  file = File.join(File.dirname(__FILE__), file)
  IO.read(file).chomp.sub(/-p.*$/, "")
end

ruby ruby_version

@elia
Copy link

elia commented Aug 8, 2012

👍

@jarl-dk
Copy link

jarl-dk commented Oct 11, 2012

👍

@mislav
Copy link
Member

mislav commented Dec 17, 2012

@sstephenson I've looked into .ruby-version file feature can be implemented via plugin but it's not possible without overriding (and thus repeating the logic for) the whole rbenv-local command. I'm interested in at least enabling hook support for this. I'm interested in your opinion in any of these options:

  1. Add support for reading the .ruby-version file similar to that in Adds support for .ruby-version files #201. The string "ruby-" would be stripped from the resulting value to enable compatibility with MRI.
  2. Add a hook. Not sure if this is a good place to introduce a hook because of possible slowdown?

@mislav
Copy link
Member

mislav commented Dec 29, 2012

We want to support reading from .ruby-version files in the current release. I've started work to do that in #300

@sstephenson
Copy link
Contributor

#302

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests