# Buglet in 'gem check --alien'

**URL:** <https://www.ruby-forum.com/t/buglet-in-gem-check-alien/113258>\
**Category:** Ruby\
**Created:** [August 29, 2007, 11:23am UTC](https://www.ruby-forum.com/t/buglet-in-gem-check-alien/113258 "2007-08-29T11:23:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hanholl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a87d85/32.png) [@hanholl](https://www.ruby-forum.com/u/hanholl)\
**Post date:** [August 29, 2007, 11:23am UTC](https://www.ruby-forum.com/t/buglet-in-gem-check-alien/113258/1 "2007-08-29T11:23:49Z")

</div>

Hello,

Running ‘gem check --alien’ will fail if there is a gem installed with  
an empty file, like actionmailer-1.3.3 and others.  
The problem is in rubygems/validator.rb:

format.file\_entries.each do |entry, data|  
# Found this file. Delete it from list  
installed\_files.delete remove\_leading\_dot\_dir(entry[‘path’])  
File.open(File.join(gem\_directory, entry[‘path’]), ‘rb’) do |f|  
unless Gem::MD5.hexdigest(f.read).to\_s ==  
Gem::MD5.hexdigest(data).to\_s  
errors[gem\_name] \<\< ErrorData.new(entry[‘path’], “installed  
file doesn’t match original from gem”)  
end  
end  
end

An empty file will produce data as nil, which leads to a TypeError on  
the hexdigest(data).  
Adding ‘data=’’ if data.nil?’ helps, but may not be the best solution.

Cheers,

Han H.

---

<div class="post-metadata">

**Author:** ![hanholl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a87d85/32.png) [@hanholl](https://www.ruby-forum.com/u/hanholl)\
**Post date:** [September 9, 2007, 8:12pm UTC](https://www.ruby-forum.com/t/buglet-in-gem-check-alien/113258/2 "2007-09-09T20:12:48Z")

</div>

On Aug 29, 2007, at 02:22, Han H. wrote:

> Hello,
> 
> Running ‘gem check --alien’ will fail if there is a gem installed with  
> an empty file, like actionmailer-1.3.3 and others.

File a bug in the tracker. Bug reports filed by email will be ignored.

---

<div class="post-metadata">

**Author:** ![hanholl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a87d85/32.png) [@hanholl](https://www.ruby-forum.com/u/hanholl)\
**Post date:** [September 10, 2007, 6:25am UTC](https://www.ruby-forum.com/t/buglet-in-gem-check-alien/113258/3 "2007-09-10T06:25:53Z")

</div>

On Mon, 10 Sep 2007 03:11:31 +0900, Eric H. wrote:

> On Aug 29, 2007, at 02:22, Han H. wrote:
> 
> > Hello,
> > 
> > Running ‘gem check --alien’ will fail if there is a gem installed with  
> > an empty file, like actionmailer-1.3.3 and others.
> 
> File a bug in the tracker. Bug reports filed by email will be ignored.

I think you meant:

“Thanks for finding that! Could you file a bug in the tracker?”

Jay

---

<div class="post-metadata">

**Author:** ![hanholl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a87d85/32.png) [@hanholl](https://www.ruby-forum.com/u/hanholl)\
**Post date:** [September 10, 2007, 6:44am UTC](https://www.ruby-forum.com/t/buglet-in-gem-check-alien/113258/4 "2007-09-10T06:44:54Z")

</div>

On Sep 9, 2007, at 21:25, Jay L. wrote:

> > ignored.
> 
> I think you meant:
> 
> “Thanks for finding that! Could you file a bug in the tracker?”

Those punctuation symbols are too hard to reach.

---

<div class="post-metadata">

**Author:** ![hanholl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a87d85/32.png) [@hanholl](https://www.ruby-forum.com/u/hanholl)\
**Post date:** [September 11, 2007, 12:17am UTC](https://www.ruby-forum.com/t/buglet-in-gem-check-alien/113258/5 "2007-09-11T00:17:55Z")

</div>

On Sep 10, 2007, at 09:15, Jay L. wrote:

> On Mon, 10 Sep 2007 13:44:19 +0900, Eric H. wrote:
> 
> > Those punctuation symbols are too hard to reach.
> 
> No superators for you then!

Nope.

---

<div class="post-metadata">

**Author:** ![hanholl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a87d85/32.png) [@hanholl](https://www.ruby-forum.com/u/hanholl)\
**Post date:** [September 10, 2007, 6:16pm UTC](https://www.ruby-forum.com/t/buglet-in-gem-check-alien/113258/6 "2007-09-10T18:16:03Z")

</div>

On Mon, 10 Sep 2007 13:44:19 +0900, Eric H. wrote:

> Those punctuation symbols are too hard to reach.

No superators for you then!
