Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bypassing bundler for auxiliary development gems

In the Gemfile of my Rails project, I am starting to have auxiliary gems like "ruby-debug19", "perftools.rb", or "irbtools". All of these really have nothing to do with the project, but rather are part of my local development setup. But since I'm using bundler, I cannot load these gems (even though they are installed system-wide) unless I add them to the Gemfile. In my view that is a bit of a code smell.

For example, I would like to be able to require 'irbtools' in rails console without adding "irbtools" to my Gemfile.

Is there a way to keep auxiliary gems out of the Gemfile and still be able to load them for debugging, profiling, etc. when I need them?

like image 523
Jo Liss Avatar asked Apr 23 '11 14:04

Jo Liss


1 Answers

Actually, you can create a group in you Gemfile like:

group :auxiliary do
  gem 'irbtools'
end

And then use bundle install --without auxiliary if you don't want to use irbtools. Why do you think adding them to Gemfile is a code smell? And if it possible to do this without adding gems to the Gemfile it will be many more code smell I think.

like image 121
Vasiliy Ermolovich Avatar answered Sep 28 '22 20:09

Vasiliy Ermolovich