Bundler.setup complains when gems outside the specified groups aren't installed. #1021

jgarber opened this Issue Feb 7, 2011 · 3 comments


None yet

4 participants

jgarber commented Feb 7, 2011

I've added rubygems-test to RedCloth so it runs the tests and posts to gem-testers.org. To make it easier on the casual user who just wants to run the tests, I pulled the compilation dependencies out of the gemspec and into a group within the Gemfile:

source :rubygems

group :compilation do
  gem 'rvm', '~> 1.2.6'
  gem 'rake-compiler', '~> 0.7.1'

In my Rakefile, I have

if File.directory? "ragel"
  Dir['tasks/**/*.rake'].each { |rake| load File.expand_path(rake) }
  # Omit generation/compile tasks and dependencies. In a gem package 
  # we only need tasks and dependencies required for running specs.
  Bundler.settings.without = [:compilation]
  Bundler.setup(:default, :development)
  load 'tasks/rspec.rake'

This works just fine after you've run bundle install --without compilation, but when rake test is run automatically as the gem is being installed, bundle install has not been run, so there is no Gemfile.lock. Instead, it complains:

Could not find gem 'rake-compiler (~> 0.7.1, runtime)' in any of the 
gem sources listed in your Gemfile.

But it shouldn't be trying to find the rake-compiler gem because it's not in the groups requested.

btatnall commented May 5, 2011

This error also occurs when you specify with a group.

Bundler.setup :default

bhh commented May 30, 2011

don't know if it's related but i have the problem with sqlite on my osx dev machine in the group :development on my rails apps
if i deploy it on the production server with the gemfile.lock and the deployment flag as supposed to. bundle works but every rake command like db:migrate crashes.
i can't use the same version of sqlite on dev and prod 4fun because osx always has newer versions.

my "solution" is to not include gemfile.lock in the repo. so i can't use the deployment flag :(
but now bundler still doesn't install the new sqlite version (i just have to make sure to install some version). but also doesn't request it on the rake commands.
that doesn't feel right for me :/ but it's working
am i doing something wrong?


Reopen with repro on latest bundler.

@xaviershay xaviershay closed this Aug 10, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment