compiling mirah

62 views
Skip to first unread message

Michal Hantl

unread,
May 9, 2011, 9:35:36 AM5/9/11
to mirah
Hey guys,
yesterday I was forced to reinstall ubuntu and I am having hard time
running my project again.

Mirah 0.0.7 complained about invalid method name "[]" and I relized I
was using 0.0.8 so I went to grab the sources and compile the thing.

First, Bitescript compiled and installed as a gem, good.
The I went to compile mirah and got this:


michal@michal-P5Q-PRO:~/dev/mirah$ rake gem --trace
(in /home/michal/dev/mirah)
rake aborted!
cannot load Java class org.jruby.org.objectweb.asm.MethodHandle
org/jruby/javasupport/JavaUtilities.java:54:in
`get_proxy_or_package_under_package'
/usr/local/lib/jruby/lib/ruby/site_ruby/shared/builtin/javasupport/java.rb:51:in
`method_missing'
/usr/local/lib/jruby/lib/ruby/gems/1.8/gems/bitescript-0.0.9/lib/bitescript/asm.rb:38:in
`ASM'
/usr/local/lib/jruby/lib/ruby/gems/1.8/gems/bitescript-0.0.9/lib/bitescript/asm.rb:4:in
`BiteScript'
/usr/local/lib/jruby/lib/ruby/gems/1.8/gems/bitescript-0.0.9/lib/bitescript/asm.rb:3:in
`(root)'
org/jruby/RubyKernel.java:1038:in `require'
/usr/local/lib/jruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in
`require'
/usr/local/lib/jruby/lib/ruby/gems/1.8/gems/bitescript-0.0.9/lib/bitescript/asm.rb:2:in
`(root)'
org/jruby/RubyKernel.java:1038:in `require'
/usr/local/lib/jruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in
`require'
/usr/local/lib/jruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in
`require'
/usr/local/lib/jruby/lib/ruby/gems/1.8/gems/bitescript-0.0.9/lib/bitescript.rb:26:in
`(root)'
org/jruby/RubyKernel.java:1038:in `require'
/home/michal/dev/mirah/lib/mirah.rb:29:in `require'
/home/michal/dev/mirah/Rakefile:22:in `(root)'
org/jruby/RubyKernel.java:1063:in `load'
/home/michal/dev/mirah/Rakefile:2383:in `raw_load_rakefile'
/usr/local/lib/jruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2017:in
`load_rakefile'
/usr/local/lib/jruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
`standard_exception_handling'
/usr/local/lib/jruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2016:in
`load_rakefile'
/usr/local/lib/jruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2000:in `run'
/usr/local/lib/jruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
`standard_exception_handling'
/usr/local/lib/jruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/usr/local/lib/jruby/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31:in `(root)'
org/jruby/RubyKernel.java:1063:in `load'
/usr/local/lib/jruby/bin/rake:19:in `(root)'

Is it possible that I should not use openjdk?
Did this happen to you?

Thanks.

--
S pozdravem, Regards
Michal Hantl

tel: +420 777 812 167
gtalk: michal...@gmail.com
skype: michal.hantl

Nick Howard

unread,
May 9, 2011, 9:41:53 AM5/9/11
to mi...@googlegroups.com

I think this is because latest bitescript requires jruby head to work. I checked out the bitescript commit before headius added invokedynamic support, and that seemed to work.

Michal Hantl

unread,
May 9, 2011, 9:49:00 AM5/9/11
to mi...@googlegroups.com
Ahh, I only tried:

To build and install from source,

$ git clone http://github.com/headius/bitescript.git
$ git clone http://github.com/mirah/mirah.git
$ cd bitescript
$ gem build bitescript.gemspec
$ gem install bitescript-*
$ cd -
$ cd mirah
$ rake gem
$ gem install pkg/mirah-*
$ cd -

and that didn't work, but this is important:

this is also what the readme says:

== For Java tools:

To build the Mirah jars from source you should have a checkout of both jruby and
bitescript in Mirah's parent directory. Run "ant jar-complete" in jruby, then in
the mirah directory "../jruby/bin/jruby -S rake jar" to build the Mirah jar. Use
"jar:complete" instead to produce a free-standing jar file with JRuby and the
JRubyParser libraries included.

Thanks!

Michal Hantl

unread,
May 9, 2011, 9:59:27 AM5/9/11
to mi...@googlegroups.com
So I am running on latest jruby, mirah and bitescript, but I still get
this exception:

java.lang.ClassFormatError: Illegal method name "[]" in class
controllers/AdminController
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass(IsolatedAppClassLoader.java:176)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at org.mortbay.util.Loader.loadClass(Loader.java:91)
at org.mortbay.util.Loader.loadClass(Loader.java:71)
at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:73)

This goes for every controller I have. It used to compile before i
reinstalled ubuntu.. I'll try to run this with sun java tomorrow.

Rib Rdb

unread,
May 9, 2011, 11:38:08 AM5/9/11
to mi...@googlegroups.com

Do you have a method named []? If so, it needs to be a macro.

-- Sent from my phone

Michal Hantl

unread,
May 9, 2011, 2:55:12 PM5/9/11
to mi...@googlegroups.com
Hmm, so th mirah 008 I used is a bit different than the one I compiled
now. That makes sense!

so how do I convert this method to a macro?

def [](param:String); returns String
@request.getParameter(param)
end

Nick Howard

unread,
May 9, 2011, 3:20:56 PM5/9/11
to mi...@googlegroups.com
macro def [] param
  quote do
    getRequestParam `param`
  end
end

def getRequestParam param:String; returns String
  @request.getParameter param
end

would work I think.

Michal Hantl

unread,
Jul 18, 2011, 7:39:20 AM7/18/11
to mi...@googlegroups.com
I just needed the same [] macro again and I noticed I hadn't thank you yet.

So.. thank you! :)

Reply all
Reply to author
Forward
0 new messages