summaryrefslogtreecommitdiff
path: root/v1.2/index.html
blob: 45c694460cc63d76139bd147006133247ff03699 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<!DOCTYPE html>
<html>
  <head>
    <title>Bundler: The best way to manage a Ruby application's gems</title>
    <meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
    <meta content='276VSYOko8B8vIu1i8i5qbj7_ql5PXo0dU69XQy-SL' name='globalsign-domain-verification'>
    <link href='/images/favicon.png' rel='shortcut icon' type='image/png'>
    <link href="/stylesheets/application.css" media="screen" rel="stylesheet" type="text/css" />
  </head>
  <body>
    <div id='body'>
      <div id='header'>
        <a class="image" href="/"><img width="725" alt="The best way to manage your application's dependencies" src="/images/gembundler.png" /></a>
      </div>
      <div id='container'>
        <div id='contents'>
          <h2>What is Bundler?</h2>
          <div id='intro'>
            Bundler maintains a consistent environment for ruby applications. It tracks an application's code and the rubygems it needs to run, so that an application will always have the exact gems (and versions) that it needs to run.
          </div>
          <h2>Would you like to</h2>
          <div class='buttons'>
            <a href="#getting-started">Get started</a>
            <a href="https://github.com/bundler/bundler/blob/master/ISSUES.md">Report a bug</a>
            <a href="/v1.2/whats_new.html">See what's new</a>
            <a href="#use-bundler">Read documentation</a>
          </div>
          <h2 id='getting-started'>
            Getting Started
          </h2>
          <div class='contents'>
            <div class='bullet'>
              <div class='description'>
                Getting started with bundler is easy! Open a terminal window and type the following:
              </div>
              <pre class="highlight plaintext">$ gem install bundler&#x000A;</pre>
            </div>
            <div class='bullet'>
              <div class='description'>
                Specify your dependencies in a Gemfile in your project's root:
              </div>
              <pre class="highlight ruby"><span class="n">source</span> <span class="s2">"https://rubygems.org"</span>&#x000A;<span class="n">gem</span> <span class="s2">"nokogiri"</span>&#x000A;<span class="n">gem</span> <span class="s2">"rack"</span><span class="p">,</span> <span class="s2">"~&gt;1.1"</span>&#x000A;<span class="n">gem</span> <span class="s2">"rspec"</span><span class="p">,</span> <span class="ss">:require</span> <span class="o">=&gt;</span> <span class="s2">"spec"</span></pre>
              <a href="/v1.2/gemfile.html">Learn More: Gemfiles</a>
            </div>
            <div class='bullet'>
              <div class='description'>
                Install all of the required gems from your specified sources:
              </div>
              <pre class="highlight plaintext">$ bundle install&#x000A;$ git add Gemfile Gemfile.lock</pre>
              <a href="/v1.2/bundle_install.html">Learn More: bundle install</a>
              <div class='notes'>
                The second command adds the Gemfile and Gemfile.lock to your repository. 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.
              </div>
            </div>
            <div class='bullet'>
              <div class='description'>
                Inside your app, load up the bundled environment:
              </div>
              <pre class="highlight ruby"><span class="nb">require</span> <span class="s2">"rubygems"</span>&#x000A;<span class="nb">require</span> <span class="s2">"bundler/setup"</span>&#x000A;&#x000A;<span class="c1"># require your gems as usual</span>&#x000A;<span class="nb">require</span> <span class="s2">"nokogiri"</span></pre>
              <a href="/v1.2/bundler_setup.html">Learn More: Bundler.setup</a>
            </div>
            <div class='bullet'>
              <div class='description'>
                Run an executable that comes with a gem in your bundle:
              </div>
              <pre class="highlight plaintext">$ bundle exec rspec spec/models</pre>
              <div class='notes'>
                <p>
                  In some cases, running executables without <code>bundle exec</code>
                  may work, if the executable happens to be installed in your system
                  and does not pull in any gems that conflict with your bundle.
                </p>
                <p>
                  However, this is unreliable and is the source of considerable pain.
                  Even if it looks like it works, it may not work in the future or
                  on another machine.
                </p>
              </div>
              <div class='description'>
                Finally, if you want a way to get a shortcut to gems in your bundle:
              </div>
              <pre class="highlight plaintext">$ bundle install --binstubs&#x000A;$ bin/rspec spec/models</pre>
              <div class='notes'>
                The executables installed into <code>bin</code> are scoped to the
                bundle, and will always work.
              </div>
              <a href="/v1.2/man/bundle-exec.1.html">Learn More: Executables</a>
            </div>
          </div>
          <h2 id='use-bundler'>Use Bundler with</h2>
          <div class='buttons'>
            <a href="/v1.2/rails3.html">Rails 3</a>
            <a href="/v1.2/rails23.html">Rails 2.3</a>
            <a href="/v1.2/sinatra.html">Sinatra</a>
            <a href="/v1.2/rubygems.html">Rubygems</a>
            <a href="/v1.2/rubymotion.html">RubyMotion</a>
          </div>
          <h2 id='learn-about'>Learn about</h2>
          <div class='buttons'>
            <a href="/v1.2/gemfile.html">Gemfile</a>
            <a href="/v1.2/bundle_install.html">Installing</a>
            <a href="/v1.2/man/bundle-update.1.html">Updating</a>
            <a href="/v1.2/deploying.html">Deploying</a>
          </div>
          <div class='buttons'>
            <a href="/v1.2/git.html">Gems from git</a>
            <a href="/v1.2/commands.html">Other commands</a>
            <a href="/v1.2/rationale.html">Why Bundler exists</a>
            <a href="/v1.2/man/bundle.1.html">The man pages</a>
          </div>
          <h2 id='get-involved'>Get involved</h2>
          <p>Bundler has a lot of contributors and users, and they all talk to each other quite a bit. If you have questions, try the IRC channel or mailing list. If you're interested in contributing to the project (no programming skills needed), read the contributing guide. If you have sponsorship or security questions, email us directly.</p>
          <div class='buttons'>
            <a href="https://github.com/bundler/bundler/blob/master/DEVELOPMENT.md">Contributing</a>
            <a href="http://groups.google.com/group/ruby-bundler">Mailing list</a>
            <a href="irc://irc.freenode.net/#bundler">IRC channel</a>
            <a href="mailto:andre.arko+terence.lee@gmail.com">Email core team</a>
          </div>
          <div class='shirts'>
            <div class='content'>
              <img src="/images/bundler-shirt.png" />
              <p>
                Want to show the world you support Bundler?
                <br>
                Buy Bundler shirts and stickers at
                <a href="http://www.devswag.com/collections/bundler">DevSwag</a>
              </p>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div id='footer'>
      <img src="/images/emocow.png" />
      <img src="/images/panda.jpg" />
      <div class='spacer'></div>
      <div id='credits'>
        <p>
          Many thanks to Bundler's <a href="/contributors.html">contributors</a>
          and <a href="/sponsors.html">sponsors</a>
        </p>
      </div>
      <div class='spacer'></div>
      <img src="/images/bundler-small.png" />
    </div>
    <a href='http://github.com/bundler/bundler/' id='github'>
      <img alt='Fork me on GitHub' src='http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png'>
    </a>
    <div id='prod-versions'>
      Docs:
      <a href="/v0.9/">v0.9</a>
      <a href="/v1.0/">v1.0</a>
      <a href="/v1.1/">v1.1</a>
      <a class="current" href="/v1.2/">v1.2</a>
      <a href="/v1.3/">v1.3</a>
      <a href="/v1.5/index.html">v1.5</a>
      <a href="/">v1.6</a>
    </div>
    <script>
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
      ga('create', 'UA-39559982-1', 'bundler.io');
      ga('send', 'pageview');
    </script>
  </body>
</html>