# HTMLDiff for jruby and ruby

**URL:** <https://www.ruby-forum.com/t/htmldiff-for-jruby-and-ruby/168556>\
**Category:** Ruby\
**Created:** [May 22, 2009, 11:17am UTC](https://www.ruby-forum.com/t/htmldiff-for-jruby-and-ruby/168556 "2009-05-22T11:17:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![virendra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/e68b1a/32.png) [@virendra](https://www.ruby-forum.com/u/virendra)\
**Post date:** [May 22, 2009, 11:17am UTC](https://www.ruby-forum.com/t/htmldiff-for-jruby-and-ruby/168556/1 "2009-05-22T11:17:42Z")

</div>

hello there

from past few days iam trying to find out a gem that can compare the  
difference between two html file. i have tried to install  
myobie-htmldiff gem but the install didnt work out properly an it gave  
me error  
ERROR: could not find gem myobie-htmldiff locally or in a repository

Note:- i have followed all the steps that were mention in the github  
myobie-htmldiff home page

i have also tried gem xhtmldiff but its seem to give me weird error  
while taking the difference between the two html file  
like  
when i tried this  
XHTMLDiff.diff(first\_file,second\_file)

ArgumentError: both arguments must be equal or both be elements. a is  
String and b is String

i wish somebody out there can help me out

Thank anyway

---

<div class="post-metadata">

**Author:** ![virendra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/e68b1a/32.png) [@virendra](https://www.ruby-forum.com/u/virendra)\
**Post date:** [May 22, 2009, 12:01pm UTC](https://www.ruby-forum.com/t/htmldiff-for-jruby-and-ruby/168556/2 "2009-05-22T12:01:23Z")

</div>

Virendra N. wrote:

> from past few days iam trying to find out a gem that can compare the  
> difference between two html file. i have tried to install  
> myobie-htmldiff gem but the install didnt work out properly an it gave  
> me error  
> ERROR: could not find gem myobie-htmldiff locally or in a repository

Looks like github hasn’t built the gem. There was a bug which was  
recently fixed which was preventing gems being built. You can ask the  
author to bump the gem version to force a rebuild, or you can build and  
install the gem yourself:

git clone git://github.com/myobie/htmldiff.git  
cd htmldiff  
gem build htmldiff.gemspec  
sudo gem install htmldiff-0.0.1.gem

If you don’t have git available, then instead of ‘git clone’ just  
download a tar or zip of the project (click the ‘download’ link on the  
github page)

---

<div class="post-metadata">

**Author:** ![virendra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/e68b1a/32.png) [@virendra](https://www.ruby-forum.com/u/virendra)\
**Post date:** [May 22, 2009, 12:25pm UTC](https://www.ruby-forum.com/t/htmldiff-for-jruby-and-ruby/168556/3 "2009-05-22T12:25:48Z")

</div>

Brian C. wrote:

> Virendra N. wrote:
> 
> > from past few days iam trying to find out a gem that can compare the  
> > difference between two html file. i have tried to install  
> > myobie-htmldiff gem but the install didnt work out properly an it gave  
> > me error  
> > ERROR: could not find gem myobie-htmldiff locally or in a repository
> 
> Looks like github hasn’t built the gem. There was a bug which was  
> recently fixed which was preventing gems being built. You can ask the  
> author to bump the gem version to force a rebuild, or you can build and  
> install the gem yourself:
> 
> git clone git://github.com/myobie/htmldiff.git  
> cd htmldiff  
> gem build htmldiff.gemspec  
> sudo gem install htmldiff-0.0.1.gem
> 
> If you don’t have git available, then instead of ‘git clone’ just  
> download a tar or zip of the project (click the ‘download’ link on the  
> github page)

i followed your step but when iam trying to do require “htmldiff” its  
give me error like that says

’ LoadError: no such file to load – htmldiff’

---

<div class="post-metadata">

**Author:** ![virendra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/e68b1a/32.png) [@virendra](https://www.ruby-forum.com/u/virendra)\
**Post date:** [May 22, 2009, 5:09pm UTC](https://www.ruby-forum.com/t/htmldiff-for-jruby-and-ruby/168556/4 "2009-05-22T17:09:22Z")

</div>

On Fri, May 22, 2009 at 8:02 PM, Pieter V. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> This might seem oddly self-serving, but you might look into the Differ gem.
> 
> [GitHub - pvande/differ: A simple gem for generating string diffs](http://github.com/pvande/differ)
> 
> While not designed to diff HTML specifically, that’s something that it  
> could most probably be set up to do. Consider giving it a try.

That’s a string differ. A proper html differ needs to be aware of the  
tree structure - it’s a different problem.

martin

---

<div class="post-metadata">

**Author:** ![virendra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/e68b1a/32.png) [@virendra](https://www.ruby-forum.com/u/virendra)\
**Post date:** [May 22, 2009, 4:33pm UTC](https://www.ruby-forum.com/t/htmldiff-for-jruby-and-ruby/168556/5 "2009-05-22T16:33:03Z")

</div>

This might seem oddly self-serving, but you might look into the Differ  
gem.

> **[GitHub - pvande/differ: A simple gem for generating string diffs](https://github.com/pvande/differ)**
>
> A simple gem for generating string diffs. Contribute to pvande/differ development by creating an account on GitHub.

While not designed to diff HTML specifically, that’s something that it  
could most probably be set up to do. Consider giving it a try.

(Full disclosure: Yeah, it’s mine.)

On Fri, May 22, 2009 at 3:25 AM, Virendra N.

---

<div class="post-metadata">

**Author:** ![virendra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/e68b1a/32.png) [@virendra](https://www.ruby-forum.com/u/virendra)\
**Post date:** [May 22, 2009, 5:32pm UTC](https://www.ruby-forum.com/t/htmldiff-for-jruby-and-ruby/168556/6 "2009-05-22T17:32:17Z")

</div>

Pardon my confusion; htmldiff appears to be a string differ (with HTML  
output) as well.
