diff options
Diffstat (limited to 'faq.html')
-rw-r--r-- | faq.html | 286 |
1 files changed, 0 insertions, 286 deletions
diff --git a/faq.html b/faq.html deleted file mode 100644 index 056a51ad1a..0000000000 --- a/faq.html +++ /dev/null @@ -1,286 +0,0 @@ -<!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 id='faq'> - FAQ - Frequently Asked Questions - </h2> - <div class='contents'> - <div class='bullet'> - <div class='description'> - <h3> - Why Can't I Just Specify Only <code>=</code> Dependencies? - </h3> - <p> - <strong>Q:</strong> I understand the value of locking my gems down - to specific versions, but why can't I just specify <code>=</code> versions - for all my dependencies in the <code>Gemfile</code> and forget about - the <code>Gemfile.lock</code>? - </p> - <p> - <strong>A:</strong> Many of your gems will have their own - dependencies, and they are unlikely to specify <code>=</code> dependencies. - Moreover, it is probably unwise for gems to lock down all of *their* - dependencies so strictly. The <code>Gemfile.lock</code> allows you to - specify the versions of the dependencies that your application needs in - the <code>Gemfile</code>, while remembering all of the exact versions of - third-party code that your application used when it last worked correctly. - </p> - <p> - By specifying looser dependencies in your <code>Gemfile</code> - (such as <code>nokogiri ~> 1.4.2</code>), you gain the ability to run - <code>bundle update nokogiri</code>, and let bundler handle updating **only** - <code>nokogiri</code> and its dependencies to the latest version that still - satisfied the <code>~> 1.4.2</code> version requirement. This also allows you - to say "I want to use the current version of nokogiri" (<code>gem 'nokogiri'</code> - in your <code>Gemfile</code>) without having to look up the exact version number, - while still getting the benefits of ensuring that your application always runs with - exactly the same versions of all third-party code. - </p> - <h3> - Why Can't I Just Submodule Everything? - </h3> - <p> - <strong>Q:</strong> I don't understand why I need bundler to manage - my gems in this manner. Why can't I just get the gems I need and stick them - in submodules, then put each of the submodules on the load path? - </p> - <p> - <strong>A:</strong> Unfortunately, that solution requires that you - manually resolve all of the dependencies in your application, including dependencies - of dependencies. And even once you do that successfully, you would need to redo that - work if you wanted to update a particular gem. For instance, if you wanted to update - the <code>rails</code> gem, you would need to find all of the gems that depended on - dependencies of Rails (<code>rack</code>, <code>erubis</code>, <code>i18n</code>, - <code>tzinfo</code>, etc.), and find new versions that satisfy the new versions of - Rails' requirements. - </p> - <p> - Frankly, this is the sort of problem that computers are good at, and which you, - a developer, should not need to spend time doing. - </p> - <p> - More concerningly, if you made a mistake in the manual dependency resolution - process, you would not get any feedback about conflicts between different dependencies, - resulting in subtle runtime errors. For instance, if you accidentally stuck the wrong - version of <code>rack</code> in a submodule, it would likely break at runtime, when - Rails or another dependency tried to rely on a method that was not present. - </p> - <p> - <strong> - Bottom line: - </strong> - even though it might seem simpler at first glance, it is decidedly significantly - more complex. - </p> - <h3> - Why Is Bundler Downloading Gems From <code>--without</code> Groups? - </h3> - <p> - <strong>Q:</strong> I ran <code>bundle install --without production</code> and - bundler is still downloading the gems in the <code>:production</code> group. Why? - </p> - <p> - <strong>A:</strong> Bundler's <code>Gemfile.lock</code> has to contain exact - versions of all dependencies in your <code>Gemfile</code>, regardless of any options - you pass in. If it did not, deploying your application to production might change all - your dependencies, eliminating the benefit of Bundler. You could no longer be sure that - your application uses the same gems in production that you used to develop and test with. - Additionally, adding a dependency in production might result in an application that is - impossible to deploy. - </p> - <p> - For instance, imagine you have a production-only gem (let's call it - <code>rack-debugging</code>) that depends on <code>rack =1.1</code>. If we did not evaluate - the production group when you ran <code>bundle install --without production</code>, you - would deploy your application, only to receive an error that <code>rack-debugging</code> - conflicted with <code>rails </code> (which depends on <code>actionpack</code>, which depends - on <code>rack ~> 1.2.1</code>). - </p> - <p> - Another example: imagine a simple Rack application that has <code>gem 'rack'</code> - in the <code>Gemfile</code>. Again, imagine that you put <code>rack-debugging</code> in the - <code>:production</code> group. If we did not evaluate the <code>:production</code> group when - you installed via <code>bundle install --without production</code>, your app would use - <code>rack 1.2.1</code> in development, and you would learn, at deployment time, that - <code>rack-debugging</code> conflicts with the version of Rack that you tested with. - </p> - <p> - In contrast, by evaluating the gems in **all** groups when you call <code>bundle install</code>, - regardless of the groups you actually want to use in that environment, we will discover the - <code>rack-debugger</code> requirement, and install <code>rack 1.1</code>, which is also compatible - with the <code>gem 'rack'</code> requirement in your <code>Gemfile</code>. - </p> - <p> - <strong> - In short, - by always evaluating all of the dependencies in your Gemfile, regardless of the dependencies - </strong> - you intend to use in a particular environment, you avoid nasty surprises when switching to a different - set of groups in a different environment. And because we just download (but do not install) the gems, - you won't have to worry about the possibility of a difficult **installation** process for a gem that - you only use in production (or in development). - </p> - <h3> - I Have a C Extension That Requires Special Flags to Install - </h3> - <p> - <strong>Q</strong>: I have a C extension gem, such as <code>mysql</code>, which requires - special flags in order to compile and install. How can I pass these flags into the installation - process for those gems? - </p> - <p> - <strong>A</strong>: First of all, this problem does not exist for the <code>mysql2</code> - gem, which is a drop-in replacement for the <code>mysql</code> gem. In general, modern C extensions - properly discover the needed headers. - </p> - <p> - If you really need to pass flags to a C extension, you can use the <code>bundle config</code> - command: - </p> - <pre class="highlight plaintext">$ bundle config build.mysql --with-mysql-config=/usr/local/mysql/bin/mysql_config
</pre> - <p> - Bundler will store this configuration in <code>~/.bundle/config</code>, and bundler will use - the configuration for any <code>bundle install</code> performed by the same user. As a result, once - you specify the necessary build flags for a gem, you can successfully install that gem as many times - as necessary. - </p> - <h3> - I Do Not Have an Internet Connection and Bundler Keeps Trying to Connect to the Gem Server - </h3> - <p> - <strong>Q</strong>: I do not have an internet connection but I have installed the gem before. - How do I get bundler to use my local gem cache and not connect to the gem server? - </p> - <p> - <strong>A</strong>: Use the --local flag with bundle install. The --local flag tells bundler - to use the local gem cache instead of reaching out to the remote gem server. - </p> - <pre class="highlight plaintext">$ bundle install --local
</pre> - <h3> - Bundling From RubyGems is Really Slow - </h3> - <p> - <strong>Q</strong>: When I bundle from rubygems it is really slow. Is there anything I can do to make it faster? - </p> - <p> - <strong>A</strong>: Add the --full-index flag when bundling from the rubygems server. This downloads - the index all at once instead of making numerous small requests to the api. - </p> - <pre class="highlight plaintext">$ bundle install --full-index</pre> - </div> - </div> - </div> - </div> - <div id='sidebar'> - <h2>Would you like to</h2> - <ul> - <li><a href="/#getting-started">Get started</a></li> - <li><a href="/issues.html">Report a bug</a></li> - <li><a href="/v1.6/whats_new.html">See what's new</a></li> - <li><a href="/v1.6/man/bundle.1.html">Read documentation</a></li> - <li><a href="/#get-involved">Discuss and Contribute</a></li> - <li><a href="/v1.6/faq.html">View FAQs</a></li> - </ul> - <div class='shirts'> - <div class='content'> - <p> - Bundler is developed entirely by a team of volunteers. - <a href="http://www.gittip.com/bundler">Support their work</a> - and help make Bundler better for everyone. - </p> - <p> - <script data-gittip-username='bundler' src='//gttp.co/v1.js'></script> - <br> - <br> - </p> - </div> - </div> - <h2>Bundler Commands</h2> - <ul> - <li><a href="/v1.6/bundle_install.html">bundle install</a></li> - <li><a href="/v1.6/bundle_update.html">bundle update</a></li> - <div class='buttons'> - <a href="/v1.6/commands.html">View all commands</a> - </div> - </ul> - <h2>Help With</h2> - <ul> - <li><a href="/v1.6/gemfile.html">Gemfiles</a></li> - <li><a href="/v1.6/groups.html">Groups</a></li> - <li><a href="/v1.6/git.html">Gems from git</a></li> - <li><a href="/v1.6/bundler_setup.html">Bundler.setup</a></li> - <li><a href="/v1.6/deploying.html">Deploying</a></li> - <li><a href="/v1.6/bundler_sharing.html">Sharing</a></li> - <li><a href="/v1.6/updating_gems.html">Updating Gems</a></li> - <li><a href="/compatibility.html">Compatible versions</a></li> - </ul> - <h2>Use Bundler with</h2> - <ul> - <li><a href="/v1.6/rails3.html">Rails 3</a></li> - <li><a href="/v1.6/rails23.html">Rails 2.3</a></li> - <li><a href="/v1.6/sinatra.html">Sinatra</a></li> - <li><a href="/v1.6/rubygems.html">Rubygems</a></li> - <li><a href="/v1.6/rubymotion.html">RubyMotion</a></li> - </ul> - <div class='shirts'> - <div class='content'> - <a class="image" onclick="ga('send', 'devswag');" href="http://www.devswag.com/collections/bundler"><img src="/images/bundler-shirt.png" /> - </a> - - <p> - <a onclick="ga('send', 'devswag');" href="http://www.devswag.com/collections/bundler">Buy Bundler Shirts & Stickers!</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 href="/v1.2/">v1.2</a> - <a href="/v1.3/">v1.3</a> - <a href="/v1.5/index.html">v1.5</a> - <a class="current" 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> |