# \[ANN\] gem\_file\_conflict\_checker (0.2.1) -- clean 'em up

**URL:** <https://www.ruby-forum.com/t/ann-gem-file-conflict-checker-0-2-1-clean-em-up/180987>\
**Category:** Ruby\
**Created:** [January 3, 2010, 2:57am UTC](https://www.ruby-forum.com/t/ann-gem-file-conflict-checker-0-2-1-clean-em-up/180987 "2010-01-03T02:57:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rogerdpack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Post date:** [January 3, 2010, 2:57am UTC](https://www.ruby-forum.com/t/ann-gem-file-conflict-checker-0-2-1-clean-em-up/180987/1 "2010-01-03T02:57:20Z")

</div>

Pleased to announced the initial release of the  
gem\_file\_conflict\_checker plugin.

Enjoy.  
-r

== README

= gem\_file\_conflict\_checker

This is a rubygems plugin that warns warn you when you accidentally  
install gems that have filenames that collide and hence are unstable.

Background:

Currently with rubygems (1.3.5), if you install two gems that have  
same-named files, like

gem1/lib/a.rb

gem2/lib/a.rb

Then do a

require ‘rubygems’  
require ‘a’

There is no guarantee of _which_ a it is going to load.

This can cause some really bizarre errors when, for example, in the  
middle of requiring gem1 gem, that gem does a

require ‘a’

which ends up requiring a _from a totally different, unexpected, other  
gem_, like gem2.

This can lead to unrelated looking errors, like

‘undefined method `sexp_type' for class `Sexp’ (NameError)’

or ‘undefined constants Sane::OS’

which really aren’t helpful to deciphering the root cause (that you have  
conflicting gems installed).

=============== What this gem does

This gem creates a rubygems post\_install hook that sanity checks your  
gems, looking for any files that could possibly conflict. If there is a  
conflict, it outputs a warning message to the screen about it.

ex:

E:\>gem install require\_all  
warning: gem\_conflict\_plugin: conflicts detected! (they may be expected)  
your rubygems have one or more gems with conflicting lib/\* filenames…  
“require\_all” was found redundantly in the libs of these gems:  
rdp-require\_all (lib/require\_all.rb), require\_all (lib/require\_all.rb)

In this example two gems were installed with conflicting (competing)  
filenames–require\_all.rb was found in rdp-require\_all and require\_all.

The post install hook warned me of the problem, and I promptly  
uninstalled the one I didn’t want so that there would be no confusion.

================== Usage/Installation

$ gem install gem\_file\_conflict\_checker  
$ gem install gem\_file\_conflict\_checker

# install it twice so that it will run its post install hooks and warn

you of any conflicts. Any gem install after this point will also warn  
you.

This is especially useful for those of us who are using various versions  
of gems and forking them and installing our own versions, etc., to  
sanity check which gems are installed. It is hoped that a future  
version of rubygems will alleviate this problem, and patches have been  
proposed [1].

Enjoy.

-r

Feedback welcome:

> **[GitHub - rdp/gem\_file\_conflict\_checker: A gem plugin to warn you when you...](https://github.com/rdp/gem_file_conflict_checker)**
>
> A gem plugin to warn you when you accidentally install files with names that collide accidentally - GitHub - rdp/gem\_file\_conflict\_checker: A gem plugin to warn you when you accidentally install fi...

refs:

[1]  
[http://rubyforge.org/tracker/index.php?func=detail&aid=27318&group\_id=126&atid=578](http://rubyforge.org/tracker/index.php?func=detail&aid=27318&group_id=126&atid=578)  
[http://www.ruby-forum.com/topic/190217](http://www.ruby-forum.com/topic/190217)
