Bundler requires Rubygems >= 1.3.6. Run gem update --system
if you have an older version.
It also is not compatible with older versions of passenger, so bring that up to date as well (2.2.15 works).
If you installed RubyGems through apt (which you should never do!), you may see a message giving you a hint to use apt to update.
Some people advise to install the 'rubygems-update-1.3.7' gem on Ubuntu systems if you used apt to install RubyGems.
I did that - and lost all local gems, so back up using gem list > ~/gem_list_backup
before you do anything.
You can also download and install RubyGems yourself.
sudo gem install bundler
Follow the instructions on bundler.io Show archive.org snapshot
boot.rb
preinitializer.rb
Gemfile
in your project root like the one attachedRemove all old config.gem ...
lines in environment.rb and environments/*.rb
Run bundle install
. This reads Gemfile
and builds Gemfile.lock
with all dependencies etc.
Add both Gemfile as well as Gemfile.lock to the repository.
Use bundle to execute your tests using the current bundled environment. Make sure you didn't break anything:
bundle exec spec spec/
bundle exec cucumber -f progress
Remove all config.gem
directives from your environments.
Copy Gemfile and Gemfile.lock to the production machine and run bundle install
.
Deploy.
Most of us have some alias scripts to run all tests (e.g. ~/bin/tests
). Update those scripts so they use bundle exec
like this:
#!/bin/sh
bundle exec cucumber -f progress && bundle exec spec spec/
As an alternative (if you are working on both projects with and without Bundler) you might want to look into this helper script.
You don't need to change stuff that calls rake
because rake
is already Bundler-aware.
We formerly used a hack Show archive.org snapshot to define a cucumber version in the past. We do not need this anymore. Therefore, open
lib/tasks/cucumber.rake
script/cucumber
and remove gem 'cucumber', '=0.4.0' if Gem.available?('cucumber')
Keep in mind that you might have to declare the version of cucumber used in the project
gem "cucumber", "0.4.0"
I18n::MissingInterpolationArgument in 'Invoice parse_functions should parse "in_days"'
missing interpolation argument in "%{count}.%m.%Y" ({:object=>Thu, 16 Sep 2010} given)
And: Don't drink & bundle!