summaryrefslogtreecommitdiff
path: root/v0.9/index.html
blob: 1ff828b18a2f2825d479320449869c024d426779 (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
171
172
173
174
175
176
177
178
179
180
181
<!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'>
          <div id='intro'>
            Bundler manages an <strong>application's dependencies</strong> through its
            entire life across many machines systematically and repeatably.
          </div>
          <h2>Getting Started</h2>
          <div class='contents'>
            <div class='bullet'>
              <div class='description'>
                Getting started with bundler is easy
              </div>
              <pre class="highlight plaintext">$ gem install bundler&#x000A;</pre>
            </div>
            <div class='bullet'>
              <div class='description'>
                If you're on an old version of Rubygems
                (before 1.3.6)
              </div>
              <pre class="highlight plaintext">$ gem update --system&#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="s1">'http://rubygems.org'</span>&#x000A;<span class="n">gem</span> <span class="s1">'nokogiri'</span>&#x000A;<span class="n">gem</span> <span class="s1">'rack'</span><span class="p">,</span> <span class="s1">'~&gt;1.1'</span>&#x000A;<span class="n">gem</span> <span class="s1">'rspec'</span><span class="p">,</span> <span class="ss">:require</span> <span class="o">=&gt;</span> <span class="s1">'spec'</span></pre>
              <a href="/v0.9/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</pre>
              <a href="/v0.9/bundle_install.html">Learn More: bundle install</a>
            </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="s1">'rubygems'</span>&#x000A;<span class="nb">require</span> <span class="s1">'bundler'</span>&#x000A;<span class="no">Bundler</span><span class="p">.</span><span class="nf">setup</span>&#x000A;&#x000A;<span class="nb">require</span> <span class="s1">'nokogiri'</span>&#x000A;<span class="c1"># any other requires you might need</span></pre>
              <a href="/v0.9/bundler_setup.html">Learn More: Bundler.setup</a>
            </div>
            <div class='bullet'>
              <div class='description'>
                Run a script provided by a bundled gem
              </div>
              <pre class="highlight plaintext">$ bundle exec rackup&#x000A;</pre>
            </div>
            <div class='bullet'>
              <div class='description'>
                When you're ready to share your application or deploy it, lock down all the versions of the gems you're using
              </div>
              <pre class="highlight plaintext">$ bundle lock&#x000A;$ git add Gemfile.lock</pre>
              <a href="/v0.9/bundle_lock.html">Learn more: bundle lock</a>
            </div>
          </div>
          <h2>Using Bundler with Frameworks</h2>
          <div class='contents'>
            <div class='bullet'>
              <div class='description'>
                Bundler works out of the box with Rails 3. Once you understand the basics of using bundler, you know everything you need to know.
                <a href="/v0.9/rails3.html">Using Bundler with Rails 3</a>
              </div>
            </div>
            <div class='bullet'>
              <div class='description'>
                Bundler works with Rails 2.3 with a small change to boot.rb and adding a preinitializer.rb.
                <a href="/v0.9/rails23.html">Using Bundler with Rails 2.3</a>
              </div>
            </div>
            <!-- .bullet -->
            <!-- .description -->
            <!-- Setting up Sinatra to use Bundler is as simple as using Bundler itself. -->
            <!-- = link_to 'Using Bundler with Sinatra', 'sinatra.html' -->
          </div>
          <h2>Checking Out an Application With a Gemfile</h2>
          <div class='contents'>
            <div class='bullet'>
              <div class='description'>
                Install the required gems
              </div>
              <pre class="highlight plaintext">$ bundle install</pre>
              <a href="/v0.9/bundle_install.html">Learn More: bundle install</a>
            </div>
          </div>
          <h2>Digging Further</h2>
          <div class='contents'>
            <div class='bullet'>
              <div class='description'>
                Store all of the required gems in your application. All future installs will get gems from this cache, bypassing rubygems.org
              </div>
              <pre class="highlight plaintext">$ bundle package</pre>
              <a href="/v0.9/bundle_package.html">Learn More: bundle package</a>
            </div>
            <div class='bullet'>
              <div class='description'>
                Put dependencies in a group, so they can be ignored at install time or required together in your application
              </div>
              <pre class="highlight ruby"><span class="n">group</span> <span class="ss">:development</span> <span class="k">do</span>&#x000A;  <span class="n">gem</span> <span class="s1">'wirble'</span>&#x000A;<span class="k">end</span></pre>
              <a href="/v0.9/groups.html">Learn more: Groups</a>
            </div>
            <div class='bullet'>
              <div class='description'>
                Use a gem that is stored in git and has a .gemspec at its root. Gemspecs with bins or C extensions are supported
              </div>
              <pre class="highlight ruby"><span class="n">gem</span> <span class="s1">'nokogiri'</span><span class="p">,</span> <span class="ss">:git</span> <span class="o">=&gt;</span> <span class="s1">'https://github.com/tenderlove/nokogiri.git'</span></pre>
              <a href="/v0.9/git.html">Learn more: Git</a>
            </div>
            <div class='bullet'>
              <div class='description'>
                Use a gem that you are actively developing on your file system
              </div>
              <pre class="highlight ruby"><span class="n">gem</span> <span class="s1">'nokogiri'</span><span class="p">,</span> <span class="ss">:path</span> <span class="o">=&gt;</span> <span class="s1">'~/Code/nokogiri'</span>&#x000A;</pre>
            </div>
            <div class='bullet'>
              <div class='description'>
                Install gems to a different location
                (the default is ~/.bundle)
              </div>
              <div class='how'>
                <pre class="highlight plaintext">$ bundle install vendor --disable-shared-gems</pre>
                <div class='notes'>
                  By specifying --disable-shared-gems, you are telling bundler to install the gems into vendor, even if they are already installed in the system
                </div>
              </div>
              <a href="/v0.9/bundle_install.html">Learn More: bundle install</a>
            </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 class="current" href="/v0.9/">v0.9</a>
      <a href="/v1.0/">v1.0</a>
      <a href="/v1.1/">v1.1</a>
      <a 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>