Bundlerの公式のトップページを読んでみた

What is Bundler?


It tracks an application's code and the rubygems it needs to run, 
それは、アプリケーションコードと、rubygemsが動くのに必要なものを監視するよ

  • track : たどる、監視・追跡する


so that an application will always have the exact gems (and versions) that it needs to run.
アプリケーションが、動くのに必要な的確なgem(とそのバージョン)を常備できるようにするよ

  • so that : 〜できるように
  • always have : 常備
  • exact : 的確な

Getting Started


Getting started with bundler is easy! Open a terminal window and run this command: 
bundler を始めるのは簡単だよ! ターミナルを開いて、以下のコマンドを入力してね

$ gem install bundler


Specify your dependencies in a Gemfile in your project's root:
依存関係を、Gemfileに書いて、あなたのプロジェクトのルートディレクトリに格納してね

  • Specify : 〜を含める
  • dependencies : 依存関係
source 'https://rubygems.org'
gem 'nokogiri'
gem 'rack', '~>1.1'
gem 'rspec', :require => 'spec'


Install all of the required gems from your specified sources: 
以下のコマンドで、あなたが書いた、望んだgemを全てインストールするよ

  • required : 望んだ
$ bundle install
$ git add Gemfile Gemfile.lock


The second command adds the Gemfile and Gemfile.lock to your repository. 
2つめのコマンドは、Gemfileと、Gemfile.lockをリポジトリに入れてるよ


This ensures that other developers on your app, as well as your deployment environment, will all use the same third-party code that you are using now. 
これは、あなたのアプリをいじる、他の開発者が、あなたの開発環境のみならず、あなたが使っている、全てのサードパーティコードを使えるようにしてくれることを確実にしてくれるよ

  • ensures : 確実にする、守る、保険を掛ける
  • as well as : 〜の前後。AだけでなくBも


Inside your app, load up the bundled environment
バンドルした環境をあなたのアプリに入れるよ

require 'rubygems'
require 'bundler/setup'

# require your gems as usual
require 'nokogiri'

訳注 : railsだとこの部分はよきにはからってくれる


Run an executable that comes with a gem in your bundle: 
あなたの bundle にある gem の実行ファイルを起動させる

$ bundle exec rspec spec/models
  • executable : 実行ファイル


In some cases, running executables without bundle exec may work, 
往々にして、bundle exec なしでも、コマンドが実行できるよ

  • In some cases : 往々にして

if the executable happens to be installed in your system and does not pull in any gems that conflict with your bundle.
あなたのシステムに入っている gem と、bundle に入っている gem がコンフリクトしていないのが理由だよ


However, this is unreliable and is the source of considerable pain. 
けど、それは信頼ならなくて、多くの面倒の種となるよ

  • source of : 原因
  • considerable : かなりの
  • pain : 痛み、苦労、深い
  • However : けれども、しかしながら
  • unreliable : 信頼ならない、頼りにならない


Even if it looks like it works, it may not work in the future or on another machine. 
たとえ今いい感じに動いているように見えても、将来や別のマシンで動くとは限らないよ

  • Even : たとえ〜でも


Finally, if you want a way to get a shortcut to gems in your bundle:
最後に、gemコマンドのショートカットが欲しい時

$ bundle install --binstubs
$ bin/rspec spec/models


The executables installed into bin are scoped to the bundle, and will always work.
binディレクトリに、bundleのgemコマンドがインストールされるよ。
それはいつでも動作するよ


そんな感じ