sanemat {AT} tachikoma.io
- Slide: EN
- Talk: JA
Money Forward, Inc.
ruby "2.3.0"
source "https://rubygems.org"
gem "ecdsa"
In Gemfile.
- Error out if the ruby version doesn't match
$ bundle
Your Ruby version is 2.3.1, but your Gemfile specified 2.3.0
(exit code: 0)
You may use this with heroku app.
Bundler v1.2.0 (Aug 30, 2012)
- add ruby to DSL, to specify version of ruby
- Tachikoma is a gem which helps
bundle update
and sends pull request. - Tachikoma.io is
Bundle Update as a Service
. - I'm a founder of both tachikoma gem and tachikoma.io :)
I use "one" ruby version, and run bundle update
with Gemfile which has ruby "2.3.0"
, ruby "2.3.1"
, ...
Run this before bundle update
.
sh(*['ruby', '-i', '-pe', '$_.gsub! /^ruby/, "#ruby"', 'Gemfile'])
:-)
GEM
remote: https://rubygems.org/
specs:
ecdsa (1.2.0)
PLATFORMS
ruby
DEPENDENCIES
ecdsa
BUNDLED WITH
1.12.0
You can store bundler version in Gemfile.lock after bundle update
.
Bundler v1.10.0 (2015-05-28)
- Bundler v1.9 always removes BUNDLED WITH section.
- Bundler v1.10 always adds BUNDLED WITH section.
I use one bundler :(
https://github.com/packsaddle/ruby-restore_bundled_with
$ restore-bundled-with
This restores BUNDLED WITH section from git repository.
GEM
remote: https://rubygems.org/
specs:
ecdsa (1.2.0)
PLATFORMS
ruby
DEPENDENCIES
ecdsa
RUBY VERSION
ruby 2.3.1p112
BUNDLED WITH
1.12.5
- If you write
ruby "2.3.1"
, then lock ruby version in Gemfile.lock. - This allows you can write
ruby "~> 2.3.0"
. - Cool!
Bundler v1.12.0 (2016-04-28)
bundle update
with v1.12.0, always add RUBY VERSION section.bundle update
with v1.12.5, if creating Gemfile.lock, then adding RUBY VERSION, if not then don't write RUBY VERSION in Gemfile.lock.
I use one ruby :)
https://github.com/packsaddle/ruby-restore_ruby_version
$ restore-ruby-version
This restores RUBY VERSION section from git repository.
This does not publish yet ;(
Future :)
- Gemfile -> gems.rb
- Gemfile.lock -> gems.locked
if File.exist?('Gemfile')
@bundler_key_file = 'Gemfile'
@bundler_lock_file = 'Gemfile.lock'
elsif File.exist?('gems.rb')
@bundler_key_file = 'gems.rb'
@bundler_lock_file = 'gems.locked'
else
@bundler_key_file = 'Gemfile'
@bundler_lock_file = 'Gemfile.lock'
end
oh
Bundler v1.13.0 (2016-09-09)
@sanemat And mention bundle patch? Now in prerelease version of Bundler. https://twitter.com/JuanitoFatas/status/774138984729448448
I don't battle be friends with bundler v1.13 yet, :)
To be continued...