bundle install only specified groups

4,959 views
Skip to first unread message

Huiming Teo

unread,
Jan 1, 2013, 7:55:19 PM1/1/13
to ruby-b...@googlegroups.com
Hi, 

Is there a way to bundle install only specified groups? For example: bundle install --only deploy

Here's my use case: 

I'm setting up Jenkins CI server to build Rails app using Capistrano. Before Jenkins can run `cap deploy`, it needs the gems required by `config/deploy.rb` to be installed on CI server. For simple use case, it only needs `capistrano` gem. But normally, we will require a few recipes from other gems e.g. delayed_job/recipes etc.

This is my current workaround:

# Gemfile
...
group :development do
  ..
end
group : test do
  ..
end
group :deploy do
  gem 'capistrano'
  gem 'capistrano-helpers'
  gem 'capistrano-ssh-helpers'
  gem 'delayed_job'
end


# Command to install gems on CI server:

bundle install --deployment --without default development test  # this will install :deploy group only


The reason I don't want to run `bundle install` is because I don't want to install all default gems on CI server, especially those with native extensions. Any suggestion or better workaround? 


--
Huiming

André Arko

unread,
Jan 2, 2013, 4:54:45 PM1/2/13
to ruby-b...@googlegroups.com
That is the currently supported way to install only a single group. Since the without groups are remembered, you should only have to type the command once.

--
You received this message because you are subscribed to the Google Groups "ruby-bundler" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ruby-bundler/-/ES8tfRWxETEJ.
To post to this group, send email to ruby-b...@googlegroups.com.
To unsubscribe from this group, send email to ruby-bundler...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ruby-bundler?hl=en.

Huiming Teo

unread,
Jan 3, 2013, 9:12:50 PM1/3/13
to ruby-b...@googlegroups.com
Ya, that's the workaround I'm using now. I'm a bit surprised this --only option is not supported at the first place. Do you think there will be any cons for adding this option?

linyu den

unread,
Jun 11, 2014, 10:50:59 PM6/11/14
to ruby-b...@googlegroups.com
I got this problem, i just want to bundle the specified group, 
how to implement my purpose.

I don't want to always `bundle install --without development production` ,, and type more terms
i just want to this `bundle install --with test` simply

BTW, maybe i have more multiple groups, not just many.


在 2013年1月2日星期三UTC+8上午8时55分19秒,Huiming Teo写道:

Ryan Mohr

unread,
Jul 7, 2014, 9:35:14 PM7/7/14
to ruby-b...@googlegroups.com
I'm finding a `bundle install --only` option would be nice too. Opened an issue for it at https://github.com/bundler/bundler-features/issues/59
Reply all
Reply to author
Forward
0 new messages