Created
December 22, 2014 10:29
-
-
Save eliotsykes/8fecb12f96bb21fcb582 to your computer and use it in GitHub Desktop.
Gemfile Ruby Version from .ruby-version file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
def ruby_version | |
version_file = ".ruby-version" | |
version_override = (File.exist?(version_file) && File.read(version_file).strip) | |
default_version = "2.1.5" | |
version_override || default_version | |
end | |
ruby ruby_version | |
# Continue with usual Gemfile: | |
gem 'rails', '4.2.0' | |
# ... etc. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment