完成第二步后rake spec
,使用gem build bundler.gemspec
and进行安装gem install --local bundler-1.6.0.rc2.gem
。
这意味着当 bundler 本身是一个 gem 并且在 rake 魔法之后,你需要安装这个 git master 版本的 bundler gem。要检查您是否使用的是 bundler 的主版本,请bundle --version
在任何目录上运行,ti 应该返回 Bundler 版本 1.6.0.rc2 或类似的东西。
http://bundler.io/v1.5/man/bundle.1.html显示了您可以在捆绑二进制文件中使用的参数。
要测试这个包的主二进制文件,请创建一个新目录并执行bundle init
,向其中添加一些要安装的 gem。例如:
# A sample Gemfile
source "https://rubygems.org"
gem "hello-world"
gem "gem-man"
and run `bundle install`.
now:
sindhu@leh ~/code/rsoc/bunch_of_gemfiles % bundle list
Gems included by the bundle:
* bundler (1.6.0.rc2)
* gem-man (0.3.0)
* hello-world (1.2.0)
sindhu@leh ~/code/rsoc/bunch_of_gemfiles % bundle check
The Gemfile's dependencies are satisfied
sindhu@leh ~/code/rsoc/bunch_of_gemfiles % bundle platform
Your platform is: x86_64-linux
Your app has gems that work on these platforms:
* ruby
Your Gemfile does not specify a Ruby version requirement.
基本上,bundle 就像 gems 的 pacman 一样,但在您想要的确切版本中提供了一个确切的 gems 子集。使用它的唯一方法是在 gems 上使用它,也就是说:使用 bundle 的这个 git master 二进制文件来安装 gems,测试应用程序的 gemfile 中的 deps 是否满足等等。