Monday, October 1, 2007

Scrubyt for JRuby

Installing JRuby

  1. Install jdk from http://java.sun.com.
  2. Download JRbuy 1.0.1 archive from http://dist.codehaus.org/jruby/
  3. Uncompress the archive
  4. Now you have folder jruby-1.0.1 with sub-folders: bin, docs, lib and samples.
  5. You can add a JRUBY_HOME environment variable pointing to this directory and then add the %JRUBY_HOME%\bin ($JRUBY_HOME/bin on UNIX) to your system PATH.
  6. The JRuby distribution's bin directory contains the jruby.bat file that is used to run the JRuby interpreter.
  7. Run jruby --version from the command line to test that JRuby is working.

Packaging JScrubyt

  1. Download archive with scrubyt-jruby from here
  2. Uncompress the archive
  3. Go to uncompressed folder
  4. Run jruby --command rake package
  5. You should have a gem package scrubyt-0.3.4-jruby.gem in folder pkg

Prepare for installing

  1. Install hpricot: gem install hpricot
  2. Install mechanize: gem install mechanize
  3. Install ruby2ruby: gem install ruby2ruby
  4. Install jrexml: gem install jrexml

Installing JScrubyt

  1. Install jscrubyt: gem install scrubyt-0.3.4-jruby.gem.

Note: Scrubyt for jruby platform can use ruby2ruby 1.1.7 and not use ParseTreeReloaded

13 comments:

renjya said...

Hi Paul,
Great work!

Could you include an example extractor file as well for all us less technical out there.

Regards

Pradeep said...

Amelie,

Its simple.. Go to the folder where the gem is present and then use that command. I did and worked for me.

Hey Paul,

Good Work.. Why don't you keeps some samples!!!

Cheers,
Pradeep

Scott said...

Paul,
Having a little trouble in the prepare to install section. keep getting a 404 error when i do gem install hpricot

Jarrad said...

this is fantastic! please maintain this

Ryan said...

When I am packaging Jscrubyt and type exactly "jruby --command rake package" in the command prompt it churns for a minute and gives an error message ":1: undefined method 'rake' for JRuby::Commands:Class (No Method Error>"

I have searched and searched for a clue what this error message means but no luck. Can anyone help me?

Vova said...

RE: ryan

I've got the same problem. Here is how I solved it.

1. I installed all the gems first (hpricot, mechanize, ruby2ruby and jrexml) - one of them will install depedancy "Rake"

2. Then in the folder "scrubyt-jruby" I ran cmd.exe and there I wrote "rake package" and it built RubyGem

3. Finally in the folder "scrubyt-jruby\pkg" I installed scrubyt gem (gem install scrubyt-0.3.4-jruby.gem)

-Matt said...

I'm having a different problem, any time I try to install *any* gem, I get the following error:

ERROR: While executing gem ... (NativeException)
org.jvyamlb.ParserException: ParserException while scanning a block mapping
we had this expected < block end >, but found org.jvyamlb.tokens.ScalarToken

Any ideas?

-Matt said...

I've wiped Windows XP, reinstalled and I'm still getting the same error message... Any help would be amazing.

pftg said...

To:-matt

Please review scrubyt forum! All problems in windows are bad environment variables. You can send to me values of JRUBY_HOME, GEM_HOME, RUBY_HOME.

Maxx said...

Hello Paul, thanks for Your work on that. Unfortunately the export method for the extractors (Export/Pattern class) is still not working. I keep getting an error like "wrong constant name proc2" increasing the number by 2 every time I call export. The error seems to be somewhere around ruby_extensions.rb:119:in `to_sexp'. Could you fix that? I would be really happy!

Maxx said...

By the way: The generated gem is called scrubyt-0.3.4-java.gem
Greetz, Max

P.S. Did find out why the export is not working?

Egze said...

If you have both Ruby and JRuby on your system, you might want to install gems like this:

jruby -S gem install hpricot

and so on

anka said...

Hi Paul,

I am using
JRuby version [x86-jruby1.0.1]
while using jscrubyt, i am getting following error .

Exception in thread "main" java.lang.NoSuchMethodError: org.jruby.RubyModule.defineAnnotatedMethods(Ljava/lang/Class;)at org.jruby.ext.openssl.ASN1.createASN1(ASN1.java:265)