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
542
votes
9 answers

Should Gemfile.lock be included in .gitignore?

I'm sort of new to bundler and the files it generates. I have a copy of a git repo from GitHub that is being contributed to by many people so I was surprised to find that bundler created a file that didn't exist in the repo and wasn't in the…
aarona
  • 35,986
  • 41
  • 138
  • 186
486
votes
6 answers

Ruby: What does 'require: false' in Gemfile mean?

Does this: gem 'whenever', require: false mean that the gem needs to be installed, or does it mean it is not required?
rafamvc
  • 8,227
  • 6
  • 31
  • 34
438
votes
6 answers

How can I specify a local gem in my Gemfile?

I'd like Bundler to load a local gem. Is there an option for that? Or do I have to move the gem folder into the .bundle directory?
picardo
  • 24,530
  • 33
  • 104
  • 151
414
votes
35 answers

You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory. (mac user)

below is what I need to do. To run the specs, you'll need to install RSpec. First, run gem install bundler in the root directory of your project. Then, run bundle install. To run a single spec file, run a command like this: bundle exec rspec…
user9426236
  • 4,141
  • 2
  • 8
  • 3
392
votes
7 answers

What does bundle exec rake mean?

What does bundle exec rake db:migrate mean? Or just bundle exec rake in general? I understand that bundle takes care of maintaining things in the Gemfile. I know what the word "exec" means. I understand that rake maintains all the…
JnBrymn
  • 24,245
  • 28
  • 105
  • 147
288
votes
8 answers

Update just one gem with bundler

I use bundler to manage dependencies in my rails app, and I have a gem hosted in a git repository included as followed: gem 'gem-name', :git => 'path/to/my/gem.git' To update this gem, I execute bundle update but it also updates all the gem…
sailor
  • 7,834
  • 3
  • 26
  • 34
265
votes
29 answers

bundle install fails with SSL certificate verification error

When I run bundle install for my Rails 3 project on Centos 5.5 it fails with an error: Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed…
mrzasa
  • 22,895
  • 11
  • 56
  • 94
209
votes
7 answers

Understanding the Gemfile.lock file

After running the bundle install command, 'Gemfile.lock' is created in the working directory. What do the directives inside that file mean? For example, let's take the following file: PATH remote: . specs: gem_one (0.0.1) GEM remote:…
Shamaoke
  • 6,222
  • 8
  • 34
  • 40
203
votes
19 answers

Importing images in TypeScript React - "Cannot find module"

I am trying to import images to use inside a React component with TypeScript. The bundler I'm using is Parcel (not Webpack). I have created a .d.ts file inside the project with the image file extension, and included it inside tsconfig.json. However,…
John
  • 2,675
  • 3
  • 13
  • 20
183
votes
12 answers

You have already activated X, but your Gemfile requires Y

When running rake I get this error: You have already activated rake 0.9.2, but your Gemfile requires rake 0.8.7. Consider using bundle exec. Using bundle exec rake instead of just rake seems to work, but is it the best way to fix this?
meow
  • 27,476
  • 33
  • 116
  • 177
177
votes
13 answers

You don't have write permissions for the /var/lib/gems/2.3.0 directory

I have ruby installed on my ubuntu 16.04. $which ruby /usr/bin/ruby $ruby -v ruby 2.3.0p0 (2015-12-25) [x86_64-linux-gnu] $gem install bundler ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions…
derek
  • 9,358
  • 11
  • 53
  • 94
175
votes
7 answers

How do I specify local .gem files in my Gemfile?

I have a couple of gem files which I install via gem install xx.gem. Can I tell Bundler to use them? Or do I have to specify the source path?
ddayan
  • 4,052
  • 6
  • 27
  • 32
170
votes
9 answers

Could not locate Gemfile

I'm certainly no Ruby developer but I have an application on my server using Ruby, Gems, and Bundler. I am trying to install another Ruby on under a different user account but on the same VPS. When I go to run bundle install I get the following…
ianyoung
  • 2,863
  • 4
  • 26
  • 31
155
votes
15 answers

Bundler: Command not found

I am hosting on a vps, ubuntu 10.04, rails 3, ruby and mysql installed correctly by following some tutorials. If I run bundle check or bundle install I get the error '-bash: bundle: command not found'. From gem list --local I see 'bundler (1.0.2,…
raphael_turtle
  • 7,154
  • 10
  • 55
  • 89
146
votes
3 answers

What is the difference between Gemfile and Gemfile.lock in Ruby on Rails

I am a beginner to Ruby on Rails and I am using Rails 3.0.9. What is the difference between Gemfile and Gemfile.lock in Rails?
Shamith c
  • 3,719
  • 3
  • 25
  • 33
1
2 3
99 100