Skip to content

Instantly share code, notes, and snippets.

@abscondment
Last active December 13, 2015 19:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abscondment/4963649 to your computer and use it in GitHub Desktop.
Save abscondment/4963649 to your computer and use it in GitHub Desktop.

Getting Pindah 0.1.3.dev to work with JRuby 1.7.2

Initial setup:

  • Java 7
  • JRuby 1.7.2 in 1.9 mode
  • Clean install from rbenv
brendan@flask:~/code$ ruby -v
jruby 1.7.2 (1.9.3p327) 2013-01-04 302c706 on Java HotSpot(TM) 64-Bit Server VM 1.7.0_13-b20 [darwin-x86_64]

install prerequisites

# you will need the latest bitescript (current as of 67e22e60fa961948e8ddd24dd15d09c08c3d7f5d)
brendan@flask:~/code/bitescript$ gem build bitescript.gemspec
brendan@flask:~/code/bitescript$ gem install bitescript-0.1.1.gem

# and bundler
brendan@flask:~/code$ gem install bundler

get mirah ready (current as of 6241541d3c6992c4b1cc58c06e728fc1be846d7f)

# bundle up, it's cold
brendan@flask:~/code/mirah$ bundle install
# ... and it needs the latest bitescript too
brendan@flask:~/code/mirah$ bundle update bitescript

actually build mirah

brendan@flask:~/code/mirah$ bundle exec rake clean clobber_package
brendan@flask:~/code/mirah$ bundle exec rake jar
brendan@flask:~/code/mirah$ bundle exec rake gem

# install the gem
brendan@flask:~/code/mirah$ gem install pkg/mirah-0.1.0.pre-java.gem

now install pindah (current as of a7ea7f09414c865316544e50c40f2a9fac965169)

brendan@flask:~/code/pindah$ gem build pindah.gemspec 
brendan@flask:~/code/pindah$ gem install pindah-0.1.3.dev.gem 

Like I said in the issue, mirah master has issues. But as you have noticed, mirah 0.0.12 isn't compatible with JRuby 1.7.2. So if you want to work around them...

Due to mirah/mirah#201 mirah's inference will fail to compile the project. You can make it work by changing HelloActivity.mirah to be like this:

package org.example.hello

import android.app.Activity
import org.example.hello.R.layout as RLayout

class HelloActivity < Activity
  def onCreate(state)
    super state
    setContentView RLayout.main
  end
end

This is an annoying compiler bug, and because of it I'm using mirah 0.0.12 and JRuby 1.6.8 still in my projects. But if you want the latest and the greatest, this is how you work around it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment