I'm developing a gem with uses bundler for its dependency management.
Now I want to use some gems but only when they are already installed in the system (shown by gem list), so I cannot add them to the Gemfile. Doing a simple
require("rmagick")
does not work because bundler seems to hide all gems not listed in the Gemfile. A simple test.rb without bundler and just containing
require "rubygems"
require "rmagick
works without any problem开发者_Go百科s.
Anybody knows how to require a gem which is not listed in the Gemfile?
As far as I know you have to include it in your Gemfile
, or include it prior to using bundler
. If you include it after you get an error. There may be a way to turn that off but I can't find it.
精彩评论