Questions tagged [bundler]

Bundler is a tool that makes it easier to keep track of what Ruby gems (and what versions of those gems) an application depends upon. It does so by installing all the gems in your application’s Gemfile. Bundler itself is a gem and can be installed with the following: $ gem install bundler

Bundler is a system that attempts to manage a Ruby application's gem dependencies across multiple developers and environments. One can define the required gems for a Ruby application in a Gemfile and then "bundle" those gems and any sub-dependencies with the application, effectively sandboxing the app -- not just to a specific set of gems, but to a specific set of gem versions.

Useful links

Example Gemfile

source "http://rubygems.org"

gem "capistrano"
gem "haml"
gem "pony", "1.1"
gem "sinatra"
gem "sinatra-content-for2" # content_for :key
gem "unicorn", "1.1.5"

group :development do
  gem "json"
  gem "mechanize"
  gem "nokogiri"
  gem "rack-test"
  gem "rspec"
end
4118 questions
89
votes
15 answers

Invalid gemspec because of the date format in specification

When I include a gem that I made, thanks to Bundler (version 1.0.12), in a Gemfile and then I try to bundle or to rake just like that: $ rake I've got this error message: Invalid gemspec in…
Zag zag..
  • 6,041
  • 6
  • 27
  • 36
88
votes
8 answers

rails bundle clean

After updating a bundle, you will have some gems that may be obsolete -- since a newer version of that gem has been installed. There is no such command under the bundle executable i.e. bundle clean. How does one get rid of these obsolete gems? This…
Igbanam
  • 5,904
  • 5
  • 44
  • 68
88
votes
6 answers

Using npm to install or update required packages just like bundler for rubygems

I love Bundler, it's great at dependency management. I love npm, installing node packages is easy! I have a nodejs app and would love to be able to specify my apps dependencies and easily install / update them wherever I deploy my app. This isn't…
Daniel Beardsley
  • 19,907
  • 21
  • 66
  • 79
87
votes
19 answers

Why won't bundler install JSON gem?

I get the following error when attempting to run cap production deploy. DEBUG [dc362284] Bundler::GemNotFound: Could not find json-1.8.1.gem for installation DEBUG [dc362284] An error occurred while installing json (1.8.1), and Bundler cannot…
Thomas
  • 2,426
  • 3
  • 23
  • 38
84
votes
2 answers

What Does Webpack 4 Expect From A Package With sideEffects: false

Webpack 4 has added a new feature: it now supports a sideEffects flag in the package.json of the modules it is bundling. From Webpack 4: released today Over the past 30 days we have worked closely with each of the frameworks to ensure that they…
Undistraction
  • 42,754
  • 56
  • 195
  • 331
84
votes
3 answers

How do I find out which gem has a specific dependency?

I commented out a gem, but 'bundle install' still won't run. How do I find out which gem has a dependency on sys-proctable? $ bundle install Fetching gem metadata from https://rubygems.org/......... Fetching gem metadata from…
Chloe
  • 25,162
  • 40
  • 190
  • 357
83
votes
2 answers

What does the ~> symbol mean in a bundler Gemfile?

What does the -> mean next to a version number in a Gemfile? For example: gem 'sass-rails', '~> 3.1.5'
brad
  • 9,573
  • 12
  • 62
  • 89
82
votes
8 answers

How to reinstall a gem using bundler

I did a bundle show and get the complete path to a gem directory. Unfortunately, I removed the directory using rm -r gem_path. Then my rails app isn't working anymore. If I try start server or start rails console it outputs the following…
waldyr.ar
  • 14,424
  • 6
  • 33
  • 64
81
votes
1 answer

What is flat bundling and why is Rollup better at this than Webpack?

I have recently been looking into rollup and seeing how it differs from Webpack and other bundlers. One thing I came across was that it is better for libraries because of "flat bundling". This is based on a tweet and from a recent PR for React to…
aug
  • 11,138
  • 9
  • 72
  • 93
79
votes
18 answers

gem install pg --with-pg-config works, bundle fails

WhenI run (as root) gem install pg -v '0.12.0' -- --with-pg-config=/usr/pgsql-9.1/bin/pg_config I get the following output: #-> gem instal pg -v '0.12.0' -- --with-pg-config=/usr/pgsql-9.1/bin/pg_config Building native extensions. This could…
YuKagi
  • 2,451
  • 3
  • 21
  • 26
77
votes
11 answers

RuntimeError with mysql2 and rails3 (bundler)

I get this error `establish_connection': Please install the mysql2 adapter: `gem install activerecord-mysql2-adapter` (no such file to load -- active_record/connection_adapters/mysql2_adapter) (RuntimeError) from…
Swistak
  • 871
  • 1
  • 6
  • 8
76
votes
7 answers

Why Bundle Install is installing gems in vendor/bundle?

Whenever I do bundle install all of the gems get installed at app_dir/vendor/bundle path and consumes loads of disk space. I also tried installing gems where it should get installed i.e gemsets while development by this: bundle install…
Amandeep Singh Bhamra
  • 1,133
  • 1
  • 8
  • 15
70
votes
12 answers

How to uninstall all gems installed using `bundle install`

How can I remove all the gems installed using bundle install in a particular RoR project. I don't want to uninstall gems that are used by other projects.
nish
  • 6,952
  • 18
  • 74
  • 128
69
votes
5 answers

How can I pass a parameter for gem installation when I run bundle install?

I added the pg gem to my gemfile gem 'pg' When I run bundle install, I get this error: Installing pg (0.10.1) with native extensions /Users/ben/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems/installer.rb:483:in `rescue in block in…
ben
  • 29,229
  • 42
  • 124
  • 179
68
votes
13 answers

Heroku push rejected, failed to install gems via Bundler

I am struggling to push my code to Heroku. And after searching on Google and Stack Overflow questions, I have not been able to find the solution. Here is What I get when I try "git push heroku master" : Heroku receiving push -----> Rails app…
ismaelsow
  • 757
  • 2
  • 6
  • 6